电脑安全

您当前的位置:主页 > 电脑安全 >

php 读取google输出到本地-网络编程

来源:[db:来源]标题:   您的    编辑:电脑技术全能网 时间:2019-09-18 18:01

原标题:php 读取google输出到本地-网络编程
   供给一款查问收录经常用的google正则表白式功效哦,咱们是获得内容而后再正则出咱们想要的内容,再在当地输入。 $TheUrl="http://www.google.cn/search?q=+site:".$q."&num=20&complete=1&hl=zh-CN&lr=&newwindow=1&as_qdr=".$t."&start=".$p."&sa=N";$TheThie=GetPage($TheUrl);}$TheBody=GetContent($TheThie,"<div id=res class=med>","<div id=bsf style"); $TheBody=iconv( "UTF-8", "gb2312//IGNORE" , $TheBody);$TheBody=str_replace("<!--z--><p><i>","<!--z--><!--<p><i>",$TheBody);$TheBody=str_replace('<br clear="all"/>','<br clear="all"/>',$TheBody); $TheBody=preg_replace('<a href="/search?num=20(.+?)amp;as_qdr=(.+?)&amp;q=site:(.+?)&amp;start=(.+?)&amp;sa=N">','a href=?q=$3&t=$2&p=$4>&nbsp;&nbsp;&nbsp;&nbsp;<!--z--',$TheBody);$TheBody=str_replace("该网站能够含有歹意软件,有能够会迫害您的电脑。","",$TheBody);$TheBody=str_replace("/interstitial?url=","",$TheBody);$TheBody=str_replace("- <nobr>","",$TheBody);$TheBody=str_replace("相似网页","",$TheBody); $total=GetContent($TheThie,"</b></div><p>","</b> - <b>"); $total=iconv( "UTF-8", "gb2312//IGNORE" , $total); $total=GetContent($total,"有 <b>","</b> 项");$total=str_replace("有 <b>","",$total);$total=str_replace(",","",$total); $total=intval($total);

上一篇:php 怎么判断用户登录了-网络编程

下一篇:没有了