Using php array_walk()

array_walk() usage:


function escape_mysql(&$val)
{
    $val = mysql_real_escape_string($val);
}

 array_walk($escape_array,'escape_mysql');