最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
php下过滤HTML代码的函数
时间:2008-04-24 编辑:简简单单 来源:一聚教程网
*----------------------
过滤HTML代码的函数
-----------------------*/
function htmlEncode($string) {
$string=trim($string);
$string=str_replace("&","&",$string);
$string=str_replace("''","''",$string);
$string=str_replace("&","&",$string);
$string=str_replace(""",""",$string);
$string=str_replace(""",""",$string);
$string=str_replace("<","<",$string);
$string=str_replace("<","<",$string);
$string=str_replace(">",">",$string);
$string=str_replace(">",">",$string);
$string=str_replace(" "," ",$string);
$string=nl2br($string);
return $string;
}
-
上一个: php中的sprintf的应用
-
下一个: PHP实现验证码
相关文章
- PHP:过滤html标签的函数 09-17
- php完美过滤HTML代码的函数 06-20
- php 过滤危险html函数 代码 09-07
- php 过滤html标签的函数代码 08-27
- PHP导出数据超时的优化建议解读 10-31
- PHP之mysql位运算解析 10-31