note 74016 added to function.addslashes
| From: | samdotfullmanatverizon at osu1 dot php dot net | Date: | Tue, 20 Mar 2007 22:37:04 +0000 |
| Subject: | note 74016 added to function.addslashes | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-124649@lists.php.net to get a copy of this message | ||
There are other functions "kind of" like this one but this should help adding slashes to a
form post which also contains arrays (and you can't access runtime quotes), or you need to add
slashes to an array which is already stripped:
<?php
function addslashes_array($a){
if(is_array($a)){
foreach($a as $n=>$v){
$b[$n]=addslashes_array($v);
}
return $b;
}else{
return addslashes($a);
}
}
?>
note this does not add slashes to the keys - you could easily modify to do this..
----
Server IP: 216.194.113.175
Probable Submitter: 70.112.113.49
----
Manual Page -- http://www.php.net/manual/en/function.addslashes.php
Edit -- https://master.php.net/note/edit/74016
Del: integrated -- https://master.php.net/note/delete/74016/integrated
Del: useless -- https://master.php.net/note/delete/74016/useless
Del: bad code -- https://master.php.net/note/delete/74016/bad+code
Del: spam -- https://master.php.net/note/delete/74016/spam
Del: non-english -- https://master.php.net/note/delete/74016/non-english
Del: in docs -- https://master.php.net/note/delete/74016/in+docs
Del: other reasons-- https://master.php.net/note/delete/74016
Reject -- https://master.php.net/note/reject/74016
Search -- https://master.php.net/manage/user-notes.php