string compare function
| From: | tomhilton | Date: | Thu, 17 Jan 2002 15:20:15 +0000 |
| Subject: | string compare function | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-15935@lists.php.net to get a copy of this message | ||
Hi, this is more of an earlier post regarding the strcmp function and my
problems with it on my Win98 machine.
This is the actual code I used for the strcmp function,
$errors=0;
if (empty($username)||empty($pword)||empty ($conf_pword)||empty($redirect))
{
echo "<h3>Please hit your browser's back button and fill in all
fields</h3>";
$errors++;
}
$comp=strcmp($conf_pword,$pword);
echo $comp;
The result ($comp) always comes back -1 when $pword is the 2nd variable, and
+1 when $pword is the 1st variable. It doesn't matter what the input is
into the variables from the form the data comes from. Is it comparing the
actual literals of the variable names?