字符前加上反斜杠,包括 单引号、双引号、反斜杠 php教程代码
function d_addslashes($string, $force = 0) {
if(!$globals['magic_quotes_gpc'] || $force) {
if(is_array($string)) {
foreach($string as $key => $val) $string[$key] = d_addslashes($val, $force);
}
else $string = addslashes($string);
}
return $string;
}