\s+(.*)\s+<\/p>/Us&#039;, $fullpage, $match); $fullpage = iconv("GB2312", "UTF-8", $match[1][0]);//echo $data1;die; preg_match_all(&#039;/
(.*)<\/p>/isU&#039;, &#039;${1}&#039;, $fullpage_post); $fullpage_post = preg_replace(&#039;/
(.*)<\/p>/Us&#039;, &#039;&#039;, $fullpage_post); //echo htmlspecialchars($fullpage_post);die; /* POST CONTENT */ preg_match_all(&#039;/
\s+(.*)\s+<\/p>/Us&#039;, $fullpage_post, $post_content); /* DEL A TAGS */ $post_cOntent= preg_replace("/]*>(.*)<\/a>/isU", &#039;${1}&#039;, $post_content[1][0]); // echo &#039;&#039;.$title.&#039;&#039;.$url.&#039;&#039;.$date.&#039;&#039;.$postCon.&#039;&#039;; /* SAVE TO DB */ $post_title_count = M(&#039;post&#039;)->where("title=&#039;$title&#039;")->count(); if ($post_title_count == 0) { $dataMySql["title"] = $title; $dataMySql["content"] = $post_content; $dataMySql["datetime"] = $date; M(&#039;post&#039;)->add($dataMySql); } } } /* LAST COUNT */ $post_count_b = M(&#039;post&#039;)->count(); $post_add_num = $post_count_b - $post_count_a; /* CALLBACK */ if ($post_count_a == $post_count_b) { echo &#039;{"success":1,"msg":"文章数无变化"}&#039;; } else { echo &#039;{"success":1,"msg":"成功采集 &#039; . $post_add_num . &#039; 篇文章"}&#039;; } } AD:真正免费,域名+虚机+企业邮箱=0元
AD:真正免费,域名+虚机+企业邮箱=0元