unction cg_stripslashes($array) {
if (is_array($array)) {
foreach ($array as $k => $v) {
$array[$k] = cg_stripslashes($v);
}
} else if (is_string($array)) {
$array = stripslashes($array);
}
return $array;
}
// 添加转义
function cg_addslashes($string) {
if(is_array($string)) {
foreach($string as $key => $val) {
$string[$key] = cg_daddslashes($val);
}
} else {
$string = addslashes($string);
}
return $string;
}
?>