Hi, I've created a function which'll escape an array of strings for me, ready for inserting into a mysql_db. Here's the function which escapes them:
function escape_strings($strings = array())
# returns an array of strings which have been escaped with mysql_escape_string
$escaped_strings = array();
foreach ($strings as $string)
$escaped_strings = mysql_escape_string($string);
I've got another function which then uses that. Here's what I'm trying to do:
function escaper ($var1, $var2)
$escaped_array = escape_strings(array(&$var1, &$var2));
Firstly, is the above valid syntax (with the '&'). Second, will this modify the original $var1 and $var2, ie will $var1 and $var2 be escaped for me? If not, how would I go about doing this?
I've made escape_strings return the escaped array, because it might be useful at some point...
"Let us smite the evil slime eating hordes who may befall us on our quest to be the ultimate programmers of the known universe!"
0 · ·