note 69452 modified in function.mysql-real-escape-string by danbrown

From: Date: Sat, 14 Mar 2009 15:07:51 +0000
Subject: note 69452 modified in function.mysql-real-escape-string by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-151931@lists.php.net to get a copy of this message
mysql_real_escape_string is a bit annoying when you need to do it over an array. <?php function mysql_real_escape_array($t){ return array_map("mysql_real_escape_string",$t); } ?> this one just mysql_real_escape's the whole array. ex) <?php $_POST=mysql_real_escape_array($_POST); ?> and then you dont have to worry about forgetting to do this. --was-- mysql_real_escape_string is a bit annoying when you need to do it over an array. function mysql_real_escape_array($t){ return array_map("mysql_real_escape_string",$t); } this one just mysql_real_escape's the whole array. ex) $_POST=mysql_real_escape_array($_POST); and then you dont have to worry about forgetting to do this. http://php.net/manual/en/function.mysql-real-escape-string.php

« previous php.notes (#151931) next »