Re: Some strings are not true ?



On Dec 31, 2:40 pm, Justin Koivisto <justin.koivi...@xxxxxxxxx> wrote:
grou...@xxxxxxxxxx wrote:
This is true: "2-3"==1

But "1-2"==1 is not true

Why ?

<?php
var_dump("2-3"==1);
var_dump("1-2"==1);
?>
Output:
bool(false)
bool(true)

Why? "2-3" evaluates to 2, "1-2" evaluates to 1. 2!=1 therefore the
first statement is false, the second one is true because 1==1

--
Posted via a free Usenet account fromhttp://www.teranews.com

OK, thanks, it makes sense now.
.