php检测网页是否被百度收录的函数代码 |
本文标签:百度收录 使用:传入一个网址,如 http://jb51.net/article/1.html ,返回1,代表已经收录;返回0,代表百度没有收录 。 复制代码 代码如下: <?php header("Content-type: text/html; charset=utf-8"); function checkBaidu($url) { $curl = curl_init(); $arr = parse_url($url); if (strpos($arr[query], http://)) { if (strpos($arr[query], ?)) { if (strpos($arr[query], /)) { if (strpos($rs, <b>.$arr[query].</b>)) { echo checkBaidu(http://jb51.net/article/1.html); 上面程序执行结果: |