note 89234 deleted from function.addslashes by thiago
| From: | thiago@php.net | Date: | Fri, 27 Feb 2009 13:52:42 +0000 |
| Subject: | note 89234 deleted from function.addslashes by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-151200@lists.php.net to get a copy of this message | ||
Note Submitter: admin at circle14 dot net
----
I like your add_slashes function to process $_POST arrays, only problem is that I needed to make a
few changes to actually get it to work for me. Here is the updated code:
<?php
function add_slashes ($an_array) {
foreach ($an_array as $key => $value) {
$an_array[$key] = addslashes($an_array[$key]);
}
return $an_array;
}
?>
and call it like this:
<?php $_POST = add_slashes($_POST); ?>
Thanks, your function saved me a few hours of coding! XD