Posted by Krustov on 11/10/07 21:37
<comp.lang.php>
<>
<Sat, 10 Nov 2007 13:09:14 -0800>
<1194728954.083106.150790@c30g2000hsa.googlegroups.com>
> Is there any function in php that will match a word exactly and if it
> finds it, it returns true.
>
> For example if I search for "CA"
>
> strVar = "Bob is from Los Angeles CA" - return true
>
> strVar "Bob is from Canada" -- returns false
>
$demo="Bob is from Los Angeles CA";
$qaz="CA";
$wsx=strpos($qaz,$demo);
if ($wsx==true) {print "exact match found";}
NOTE: untested and you may need to play around with it .
[Back to original message]
|