//取消HTML代码
function shtmlspecialchars($string) {
if(is_array($string)) {
foreach($string as $key => $val) {
$string[$key] = shtmlspecialchars($val);
}
} else {
$string = preg_replace(‘/&((#(\d{3,5}|x[a-fA-F0-9]{4})|[a-zA-Z][a-z0-9]{2,5});)/', ‘&\\1′,
str_replace(array(‘&', ‘”‘, ‘<', ‘>'), array(‘&', ‘"', ‘<', ‘>'), $string));
}
return $string;
}
php htmlspecialchars加强版
内容版权声明:除非注明,否则皆为本站原创文章。
转载注明出处:http://www.heiqu.com/8d81e9b06339aa11c92f8c85c6ad763a.html