开发者

mysql_real_escape_string shortcut

开发者 https://www.devze.com 2023-02-14 02:38 出处:网络
i have an array with around 10 key values. which is the best way to add mysql_real_escape_string to all of them 开发者_如何学编程?$escaped_array=array_map(\'mysql_real_escape_string\',$array);

i have an array with around 10 key values. which is the best way to add mysql_real_escape_string to all of them 开发者_如何学编程?


$escaped_array=array_map('mysql_real_escape_string',$array);

Look at array_map


You can create short-cut method.. something like this ..

function mres($v){
    return mysql_real_escape_string($v);
}

and you can use mres as a function.

0

精彩评论

暂无评论...
验证码 换一张
取 消