strcmp returns 0 if the two strings are equal. In any case, why not just do
if ($city == $city_new) $error = true; > -----Original Message----- > From: andy [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, June 11, 2002 9:10 AM > To: [EMAIL PROTECTED] > Subject: [PHP] comparing strings does not work > > > Hi there, > > I would like to compare 2 strings. > > I do always get a 0 return (not equal) but they are > difinatelly equal, I > double checked it. They are just in two different vars. > > Here is how I did it: > > if (strcmp($city, $city_new) != 0) $error = true; > > Does anybody see the error? Or am I going the wrong way? > > Andy > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php