note 73901 added to function.stripslashes

From: Date: Wed, 14 Mar 2007 21:08:33 +0000
Subject: note 73901 added to function.stripslashes
Groups: php.notes 
Request: Send a blank email to php-notes+get-124457@lists.php.net to get a copy of this message
To use the stripslashes_deep() function noted above with PHP versions < 4.0.6, use this function: <?php function stripslashes_deep(&$var) { if (is_string($var)) { $var = stripslashes($var); } else { if (is_array($var)) { foreach($var AS $key => $value) { stripslashes_deep($var[$key]); } } } } ?> This function will also directly change the variable. Example usage at http://putnote.net/15 ---- Server IP: 192.35.244.50 Probable Submitter: 80.120.37.50 ---- Manual Page -- http://www.php.net/manual/en/function.stripslashes.php Edit -- https://master.php.net/note/edit/73901 Del: integrated -- https://master.php.net/note/delete/73901/integrated Del: useless -- https://master.php.net/note/delete/73901/useless Del: bad code -- https://master.php.net/note/delete/73901/bad+code Del: spam -- https://master.php.net/note/delete/73901/spam Del: non-english -- https://master.php.net/note/delete/73901/non-english Del: in docs -- https://master.php.net/note/delete/73901/in+docs Del: other reasons-- https://master.php.net/note/delete/73901 Reject -- https://master.php.net/note/reject/73901 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#124457) next »