摘要: 原字符串1,2,3,4,5,6, 去掉最后一个字符",",最终结果为1,2,3,4,5,6 代码如下: 系统自带的函数即可实现这样的效果,两种方法: 阅读全文
posted @ 2016-06-30 11:21 _DongGe 阅读(137) 评论(0) 推荐(0) 编辑
摘要: strip_tags() 函数剥去字符串中的 HTML、XML 以及 PHP 的标签。 阅读全文
posted @ 2016-06-30 11:20 _DongGe 阅读(154) 评论(0) 推荐(0) 编辑
摘要: 1 $str=preg_replace("/]*?src\s*=\s*(\'|\")(.*?)\\1[^>]*?\/?\s*>/i", " ", $str); //过滤img标签 2 3 $str=preg_replace("/\s+/", " ", $str); //过滤多余回车 4 5 $str=preg_replace("//si","",$str); //注释 8 ... 阅读全文
posted @ 2016-06-30 11:19 _DongGe 阅读(172) 评论(0) 推荐(0) 编辑