Re: Some strings are not true ?
- From: Tim Roberts <timr@xxxxxxxxx>
- Date: Mon, 31 Dec 2007 21:53:16 GMT
groups2@xxxxxxxxxx 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@xxxxxxxxx
Providenza & Boekelheide, Inc.
.
- References:
- Some strings are not true ?
- From: groups2
- Some strings are not true ?
- Prev by Date: Re: imagetruecolortopalette returns a max of 128 colors
- Previous by thread: Re: Some strings are not true ?
- Index(es):