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

From: Date: Sat, 14 Mar 2009 15:08:29 +0000
Subject: note 68476 modified in function.mysql-real-escape-string by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-151933@lists.php.net to get a copy of this message
A quick function to mysql_real_escape_string every value in array (Think $_SESSION and $_POST guys). This may be simple, and to some bloody obvious, but its useful little function, and I could find one on this page so: <?php function CleanArray($array) { foreach ($array as $key => $value) { $array[$key] = mysql_real_escape_string($value); } return $array; } ?> --was-- A quick function to mysql_real_escape_string every value in array (Think $_SESSION and $_POST guys). This may be simple, and to some bloody obvious, but its useful little function, and I could find one on this page so: function CleanArray($array) { foreach ($array as $key => $value) { $array[$key] = mysql_real_escape_string($value); } return $array; } http://php.net/manual/en/function.mysql-real-escape-string.php

« previous php.notes (#151933) next »