note 33804 added to function.is-bool
| From: | daevid at daevid dot com | Date: | Tue, 08 Jul 2003 08:12:11 +0000 |
| Subject: | note 33804 added to function.is-bool | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-51679@lists.php.net to get a copy of this message | ||
Because PHP annoyingly doesn't convert booleans to any sort of printable value when you echo or
print them, use a little function like this:
function printArray($myArray)
{
reset ($myArray);
while (list ($key, $val) = each ($myArray))
{
if (is_bool($val)) $val = ($val) ? "true" : "false";
echo "[$key] => $val<BR>\n";
}
}
----
Manual Page -- http://www.php.net/manual/en/function.is-bool.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33804
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33804&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33804&report=yes