|
Posted by Tim Roberts on 12/31/07 21:53
groups2@reenie.org wrote:
>
>This is true: "2-3"==1
>
>But "1-2"==1 is not true
>
>Why ?
I get exactly the opposite results with the antique PHP 4.1.2 on my Linux
system.
What's happening here is that PHP tries to convert the string to an integer
for the comparison, and that conversion stops at the first non-digit (the
"-").
So, converting "2-3" produces the integer 2, and converting "1-2" produces
the integer 1.
--
Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
Navigation:
[Reply to this message]
|