note 90019 added to function.addslashes

From: Date: Thu, 02 Apr 2009 05:13:57 +0000
Subject: note 90019 added to function.addslashes
Groups: php.notes 
Request: Send a blank email to php-notes+get-152735@lists.php.net to get a copy of this message
@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); ?> ---- Server IP: 208.69.120.35 Probable Submitter: 76.115.192.59 ---- Manual Page -- http://www.php.net/manual/en/function.addslashes.php Edit -- https://master.php.net/note/edit/90019 Del: integrated -- https://master.php.net/note/delete/90019/integrated Del: useless -- https://master.php.net/note/delete/90019/useless Del: bad code -- https://master.php.net/note/delete/90019/bad+code Del: spam -- https://master.php.net/note/delete/90019/spam Del: non-english -- https://master.php.net/note/delete/90019/non-english Del: in docs -- https://master.php.net/note/delete/90019/in+docs Del: other reasons-- https://master.php.net/note/delete/90019 Reject -- https://master.php.net/note/reject/90019 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#152735) next »