note 54394 deleted from function.array-map by philip
| From: | philip@php.net | Date: | Thu, 22 Feb 2007 02:01:08 +0000 |
| Subject: | note 54394 deleted from function.array-map by philip | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-123690@lists.php.net to get a copy of this message | ||
Note Submitter: arunas Baltuonis
----
In PHP5 array_map doesn't check "arrays in arrays". Here is simple example how to
clean deep all array.
function clean ( $string )
{
if (is_array($string))
{
return array_map('clean', $string);;
}
return ereg_replace("[^[:space:]a-zA-Z0-9*_.-\]\[]", " ", $string);
}
$_GET = array_map('clean', $_GET);
$_POST = array_map('clean', $_POST);