Discuz daddslashes 函数 转义 对所有引号签名加反斜杠
/*** 对字符串或者输入进行 addslashes 操作
* @param <mix> $string
* @param <int> $force
* @return <mix>
*/
function daddslashes($string, $force = 1) {
if(is_array($string)) {
$keys = array_keys($string);
foreach($keys as $key) {
$val = $string[$key];
unset($string[$key]);
$string = daddslashes($val, $force);
}
} else {
$string = addslashes($string);
}
return $string;
}
页:
[1]