another correction to the preceding "correction":
"as the documention states" is right,
"any non-empty string is true" is wrong : (bool) "0" === false !
(but "00" and "0.0" etc. are true!)
So watch out, you can NOT test for non-empty strings using e.g.
<?php
if (is_string($s))
if ($s) echo " '$s' is a non-empty string";
else echo " '$s' is an empty string"; else echo " $s is not a string ";
?>
indeed, for $s='0' this would print: " '0' is an empty string"
which is wrong, of course.
This is particularly "dangerous" in connection with MySQL
which prints FALSE by default as 0,
which comes back from a FORM POST as string '0',
while PHP prints FALSE as empty string (!);
a similar problem is to preserve a NULL value through a FORM post....