View Full Version : Why isn't the if comparision working?

05-11-2004, 10:21 AM
This always seems to return as true..

if (strtolower($searchperson) == strtolower('$first') or strtolower('$last') or strtolower('$first $last')) {

Any ideas why?

05-11-2004, 11:24 AM
anything within single quotes is ignored by PHP ... e.g.

$first='blah ';
echo $first;
echo "$first";
echo '$first';
if (
strtolower($searchperson) == strtolower( $first ) ||
strtolower($searchperson) == strtolower( $last ) ||
strtolower($searchperson) == strtolower("$first $last")

05-11-2004, 01:09 PM
I initially tried it with no quotes around them but then I got errors so then I tried single & double quotes around them & both those always returned true results every time.

05-11-2004, 01:21 PM
Hmmmm.... I tried doing it that way before on the single line but it didn't work; however that works.


EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum