At 8:13 AM +0000 5/23/11, Ford, Mike wrote:
> -----Original Message-----
> From: tedd [mailto:tedd.sperl...@gmail.com]
> >On Sat, 21 May 2011 09:26:02 -0400, tedd wrote:
> >> The function strcmp() simply evaluates two strings and reports
> back -1, 0, or 1 depending upon their alphabetical relationship.
>It might do that, but don't bet your horse on it.
It works that way for me.
Are you absolutely certain about that?
echo strcmp('These are nearly equal', 'These are almost equal'), "\n";
echo strcmp('different', 'unequal'), "\n";
echo strcmp('b', 'a'), "<br />\n";
The description of the function merely says that the result is <0, 0 or >0
-- it makes no promises about the actual value when it is non-zero.
That's interesting. Try the same comparisons here:
For me they are 1, -1, and 1.
Someone with more smarts than me* will have to figure this one out.
PS: * I can hear the peanut gallery saying "That won't be hard." :-)
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php