Hello Robin,

Very simple. :)

RC> <? $qty = "0" ; if ($qty != "test") print "qty is not test"; ?>

$qty is string, so PHP compares "0" with "test" char by char. chr("0")
isn't equal "t".

RC> <? $qty = 0 ; if ($qty != "test") print "qty is not test"; ?>

In this case $qty is integer value, so PHP tries to convert "test" to
integer value [ integer("test") == 0], so last condition result is
FALSE.
Is it clear?

RC> Thanks,
RC> Robin

-- 
Best regards,
Vitali Falileev                          mailto:[EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to