摘要: function DeleteHtml($str) { /*$str=preg_replace("/\s+/", " ", $str); //过滤多余回车 $str=preg_replace("/<[ ]+/si","<",$str); //过滤<__("<"号后面带空格) $str=preg_re 阅读全文
posted @ 2018-12-06 13:23 yahn~ 阅读(3008) 评论(0) 推荐(0)
摘要: function DeleteHtml(){ //清除空格和换行 $str = trim($str); //清除字符串两边的空格 $str = strip_tags($str,""); //利用php自带的函数清除html格式 $str = preg_replace("/\t/","",$str); 阅读全文
posted @ 2018-12-06 12:03 yahn~ 阅读(480) 评论(0) 推荐(0)
摘要: 两个源文件11.html和test.html 基本是一样的,现在需要匹配相似度的百分比,并且引入Simple_html_dom.php文件进行去标签处理,代码如下: <?php include 'Simple_html_dom.php';$str = file_get_contents("11.ht 阅读全文
posted @ 2018-12-06 10:15 yahn~ 阅读(618) 评论(0) 推荐(0)