note 16157 added to function.print-r
| From: | j-f at php2 dot chek dot com | Date: | Thu, 18 Oct 2001 08:31:17 +0000 |
| Subject: | note 16157 added to function.print-r | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-19083@lists.php.net to get a copy of this message | ||
To quote HTML special chars in an array before print_r(), use the following (an extra flag for
print_r() would be useful!):
array_walk(&$array, 'quote');
print_r($array);
function quote(&$val) {
if (is_array($val)) {
array_walk(&$val, 'quote');
return;
}
$val = htmlentities($val);
}
--
http://www.php.net/manual/en/function.print-r.php
http://master.php.net/manage/user-notes.php?action=edit+16157
http://master.php.net/manage/user-notes.php?action=delete+16157
http://master.php.net/manage/user-notes.php?action=reject+16157