note 88771 modified in function.addslashes by danbrown
| From: | danbrown@php.net | Date: | Fri, 06 Feb 2009 21:44:39 +0000 |
| Subject: | note 88771 modified in function.addslashes by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-150321@lists.php.net to get a copy of this message | ||
this is my version of an addslashes function, useful for processing $_POST array:
<?php
function add_slashes ($an_array) {
foreach ($an_array as $key => $value) {
$new_array[$key] = addslashes($an_array[$key]);
}
}
?>
then call it:
<?php add_slashes($_POST); ?>
--was--
this is my version of an addslashes function, useful for processing $_POST array:
function add_slashes ($an_array) {
foreach ($an_array as $key => $value) {
$new_array[$key] = addslashes($an_array[$key]);
}
}
then call it:
add_slashes($_POST);
http://php.net/manual/en/function.addslashes.php