Home >Backend Development >PHP Tutorial >Example of php getting domain name included in google_PHP tutorial

Example of php getting domain name included in google_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 10:35:181039browse

复制代码 代码如下:

function get_index($domain){
$url="http://www.google.com/search?source=hp&biw=1440&bih=762&q=site%3A$domain&aq=f&aqi=g10&aql=&oq=";
$html=file_get_contents($url);
preg_match('/
[Ss].*/Ui', $html,$index);
for($i=0;$i<=strlen($index['0']);$i++){
if(is_numeric($index['0'][$i])){
$count.=$index['0'][$i];
}
}
return $count;
}

www.bkjia.comtruehttp://www.bkjia.com/PHPjc/745208.htmlTechArticle复制代码 代码如下: function get_index($domain){ $url="http://www.google.com/search?source=hpbih=762aq=faql= $html=file_get_contents($url); preg_match('/div id=resultStats[...
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn