Re: Simple script but confusion with comparing strings (SOLVED)
| From: | Ryan A | Date: | Sun, 01 Feb 2004 01:38:58 +0000 |
| Subject: | Re: Simple script but confusion with comparing strings (SOLVED) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-176488@lists.php.net to get a copy of this message | ||
Hey,
Thanks, it worked!
-Ryan
On 2/1/2004 1:13:32 AM, Stuart (lists@sharedserver.net) wrote:
> Ryan A wrote:
> > $somecontent = strtoupper(md5($type));
>
> compared to...
>
> > if(strcmp($contents,md5("1"))==0)
>
> Comparing uppercase to lowercase (md5 generates a lowercase string).
> Either remove the strtoupper when first generated, strtoupper the md5
> result in the comparison or use strcasecmp instead of strcmp.
>
> --
> Stuart