note 90019 deleted from function.addslashes by danbrown
| From: | danbrown@php.net | Date: | Thu, 02 Apr 2009 13:39:11 +0000 |
| Subject: | note 90019 deleted from function.addslashes by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-152762@lists.php.net to get a copy of this message | ||
Note Submitter: aldo [at] mschat [ DOT ] net
----
@leocullen at fastmail dot fm
Just a note, from what it appears, your add_slashes function wouldn't work at all ;) You are
not returning anything, nor are you using a reference.
You would need to do something like:
<?php
function add_slashes ($an_array)
{
$new_array = array();
foreach($an_array as $key => $value)
{
$new_array[addslashes($key)] = addslashes($value);
}
return $new_array;
}
?>
And you would call on it like:
<?php
$_POST = add_slashes($_POST);
?>