Posted in PHP onFebruary 16, 2010
//取消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加强版
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@