note 92720 modified in function.addslashes by danbrown
| From: | danbrown@php.net | Date: | Wed, 05 Aug 2009 17:27:16 +0000 |
| Subject: | note 92720 modified in function.addslashes by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-159132@lists.php.net to get a copy of this message | ||
Hi,
I use this recursive function for POST. It handles multidimensional arrays.
<?php
function as_array(&$arr_r)
{
foreach ($arr_r as &$val) is_array($val) ? as_array($val):$val=addslashes($val);
unset($val);
}
as_array($_POST);
?>
--was--
Hi,
I use this recursive function for POST. It handles multidimensional arrays.
function as_array(&$arr_r)
{
foreach ($arr_r as &$val) is_array($val) ? as_array($val):$val=addslashes($val);
unset($val);
}
as_array($_POST);
http://php.net/manual/en/function.addslashes.php