预览模式: 普通 | 列表

PHP 过滤HTML代码空格,回车换行符的函数

PHP代码
  1. /** 
  2.  * PHP 过滤HTML代码空格,回车换行符的函数 
  3.  * echo deletehtml() 
  4.  */  
  5. function deletehtml($str)  
  6. {  
  7. $str = trim($str);  
  8. $str=strip_tags($str,"");  
  9. $str=preg_replace("{\t}","",$str);  
  10. $str=preg_replace("{\r\n}","",$str);  
  11. $str=preg_replace("{\r}","",$str);  
  12. $str=preg_replace("{\n}","",$str);  
  13. $str=preg_replace("{ }","",$str);  
  14. return $str;  
  15. }  

Tags: php

分类:技术文章 | 固定链接 | 评论: 0 | 引用: 0 | 查看次数: 2038

 广告位

↑返回顶部↑