PHP printed boolean value is empty, why?
Solution 1:
Be careful when you convert back and forth with boolean, the manual says:
A boolean TRUE value is converted to the string "1". Boolean FALSE is converted to "" (the empty string). This allows conversion back and forth between boolean and string values.
So you need to do a:
echo (int)$local_rates_file_exists."<br>";
Solution 2:
About converting a boolean to a string, the manual actually says:
A boolean TRUE value is converted to the string "1". Boolean FALSE is converted to "" (the empty string). This allows conversion back and forth between boolean and string values.
A boolean can always be represented as a 1 or a 0, but that's not what you get when you convert it to a string.
If you want it to be represented as an integer, cast it to one:
$intVar = (int) $boolVar;