...

View Full Version : finding a character inside a string ?



mutasim
06-05-2007, 08:22 PM
:) Problem solved...

Rep added..

aedrin
06-05-2007, 08:28 PM
if (strstr($url, '?') !== false) {
// url contains the question mark
} else {
// url does not contain the question mark
}

mutasim
06-05-2007, 08:32 PM
Thanks aedrin ;)

Just removing code... for privacy reasons

aedrin
06-05-2007, 10:00 PM
$aff_link2 =$aff_link1."&sid=".$userid;

mutasim
06-05-2007, 10:18 PM
:) Thanks again...

aedrin
06-05-2007, 11:11 PM
$aff_link1 = "http://www.affiliateurlhere.com/index.php?ab=23";
if (strstr($add_link1, '?') !== false) {


$aff_link1 and $add_link1, typo?

Also, use strpos instead of strstr. I forgot that it is more efficient when you only need to know if it exists or not.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum