I have encounteed an issue with php treating "0" differently.
I run following script on 2 different machines:
$a = "0";
if ($a) {
echo("helo");
}
1) Local Machine -> PHP 5.2.17 -> it treated "0" as valid and print the 'helo'
2) Server -> PHP 5.3.6 -> it treated "0" as empty/false and won't print the 'helo'
Is this due to the php configuration (if yes, what configuration) or php version?
$a = "0";(just tested it on CLI and through Apache to make sure). You must have had another character in the string as well - maybe a whitespace character that was invisible when printed, like\r?