Posted by Carl Vondrick on 02/28/06 03:15
Smiley wrote:
> In part of my script, I'm testing 2 variables - $price and $amount - to make
> sure they're the same. If they're not the same an error message should come
> up.
>
> But the error message comes up even when they are the same. I've added a
> small test to make sure of it:
>
> if($price != $amount)
> {
> echo "|$price|$amount|";
> }
>
> I go the following result:
> |24.95|24.95|As you can see, there is no extraneous invisible character in
> either variable. Both are exactly the same. So why did they evaluate as
> not equal to one another??
>
>
Compare the hashes:
<?php
echo md5($price) . ' - ' . md5($amount) . "\n";
echo sha1($price) . ' - ' . sha1($amount);
?>
What is the result?
--
Carl Vondrick
www.carlsoft.net
usenet [at] carlsoft [dot] net
Navigation:
[Reply to this message]
|