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);//开源代码phpfensi.com
- }
- else $string = addslashes($string);
- }
- return $string;
- }