The php method for obtaining the Baidu snapshot date of the website to obtain the Baidu snapshot. Php: how to get the Baidu snapshot date of the website. This article describes how to get the Baidu snapshot date of the website by php. Share it with you for your reference. For details, refer to: how does php obtain the Baidu snapshot date of a website and how does php obtain Baidu snapshots?
This example describes how to obtain the date of a website Baidu snapshot by using php. Share it with you for your reference. The details are as follows:
Online demo _ php get the snapshot time of a website
<? Php $ k = isset ($ _ POST ['K'])? $ _ POST ['K']: '';?> <? Php/* php obtains the snapshot time of a website by enenba 2012-6-18 @ param str $ url first-level domain name @ param str time format */function getKuaiZhao ($ text) {$ url = 'http: // www.baidu.com/s? Word = '. $ text; $ html = file_get_contents ($ url); $ text = str_replace ('. ','\. ', addslashes ($ text); $ search = '/'. $ Text.' <\/B> [^ <] * (? : 19 | 20) [0-9] {2 }-(? : 1 [012] | [1-9])-(? : [12] [0-9] | 3 [01] | [1-9])/'; preg_match ($ search, $ html, $ r ); // highlight_string ($ search); return $ r [1];} if ($ k = '') {echo ('Enter url ');} else {if ($ r = getKuaiZhao ($ k) {echo 'snapshot :'. $ r ;}else {echo ('No snapshot') ;}}?>
I hope this article will help you with php programming.
Examples in this article describes how to obtain the Baidu snapshot date of a website by php. Share it with you for your reference. Details: h...