note 14110 deleted from function.stripslashes by aidan

From: Date: Sun, 29 Aug 2004 10:24:11 +0000
Subject: note 14110 deleted from function.stripslashes by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-75542@lists.php.net to get a copy of this message
Note Submitter: fferreres at joydivision dot com dot ar ---- Same as above, but seems to work for multidimensional arrays...usefull when you need large arrays (for example, when you want to serialize var into a database and then bring it back) ... It asumes you have magic quotes on. function stripslashes_array($arr = array()) { $rs = array(); while (list($key,$val) = each($arr)) { if(is_array($arr[$key])) $rs[$key] = stripslashes_array($arr[$key]); else $rs[$key] = htmlspecialchars(stripslashes($val),ENT_QUOTES); } return $rs; }

« previous php.notes (#75542) next »