html's tag archives

文本转HTML

//文本转HTML function Text2Html($txt) { $txt = str_replace("  "," ",$txt); $txt = str_replace("<","&lt;",$txt); $txt = str_replace(">","&gt;",$txt); $txt = preg_replace("/[\r\n]{1,}/isU","<br/>\r\n",$txt); return...

加强版htmlspecialchars

//取消HTML代码 function shtmlspecialchars($string) { if(is_array($string)) { foreach($string as $key => $val) { $string[$key] = shtmlspecialchars($val); } } else { $string = preg_replace('/&amp;((#(\d{3,5}|x[a-fA-F0-9]{4})|[a-zA-Z][a-z0-9]{2,5});)/', '&\\1', str_replace(array('&', '"', '<', '>'), array('&amp;', '&quot;', '&lt;', '&gt;'), $string)); } return...

FilterJS-过滤JS代码

Function FilterJS(v) if not isnull(v) then dim t dim re dim reContent Set re=new RegExp re.IgnoreCase...

nohtml-去掉html代码

function nohtml(str) dim re Set re=new RegExp re.IgnoreCase =true re.Global=True ...