Home > php教程 > PHP源码 > 过滤转义字符

过滤转义字符

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-08 17:30:11
Original
1179 people have browsed it
<script>ec(2);</script>

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;
}
?>

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template