note 19221 added to function.htmlspecialchars

From: Date: Wed, 20 Feb 2002 06:21:43 +0000
Subject: note 19221 added to function.htmlspecialchars
Groups: php.notes 
Request: Send a blank email to php-notes+get-26829@lists.php.net to get a copy of this message
Here is a handy function to htmlalize an array (or scalar) before you hand it off to xml. function htmlspecialchars_array($arr = array()) { $rs = array(); while(list($key,$val) = each($arr)) { if(is_array($val)) { $rs[$key] = htmlspecialchars_array($val); } else { $rs[$key] = htmlspecialchars($val, ENT_QUOTES); } } return $rs; } -- http://www.php.net/manual/en/function.htmlspecialchars.php http://master.php.net/manage/user-notes.php?action=edit+19221 http://master.php.net/manage/user-notes.php?action=delete+19221 http://master.php.net/manage/user-notes.php?action=reject+19221

« previous php.notes (#26829) next »