note 91675 added to function.htmlspecialchars
| From: | hm2katphp dot net at osu1 dot php dot net | Date: | Mon, 22 Jun 2009 17:02:28 +0000 |
| Subject: | note 91675 added to function.htmlspecialchars | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-157243@lists.php.net to get a copy of this message | ||
<?php
/**
* A recursive version of htmlspecialchars() for arrays and strings.
*
*/
function htmlspecialchars_deep($mixed, $quote_style = ENT_QUOTES, $charset = 'UTF-8')
{
if (is_array($mixed)) {
foreach($mixed as $key => $value) {
$mixed[$key] = htmlspecialchars_deep($value, $quote_style, $charset);
}
} elseif (is_string($mixed)) {
$mixed = htmlspecialchars(htmlspecialchars_decode($mixed, $quote_style), $quote_style,
$charset);
}
return $mixed;
}
----
Server IP: 92.48.74.199
Probable Submitter: 82.152.138.226
----
Manual Page -- http://www.php.net/manual/en/function.htmlspecialchars.php
Edit -- https://master.php.net/note/edit/91675
Del: integrated -- https://master.php.net/note/delete/91675/integrated
Del: useless -- https://master.php.net/note/delete/91675/useless
Del: bad code -- https://master.php.net/note/delete/91675/bad+code
Del: spam -- https://master.php.net/note/delete/91675/spam
Del: non-english -- https://master.php.net/note/delete/91675/non-english
Del: in docs -- https://master.php.net/note/delete/91675/in+docs
Del: other reasons-- https://master.php.net/note/delete/91675
Reject -- https://master.php.net/note/reject/91675
Search -- https://master.php.net/manage/user-notes.php