Google indexing example for retrieving domain names using php. The copy code is as follows: functionget_index ($ domain) {$ urlwww. google. comsearch? Sourcehpbi1_62aqfaql $ htmlfile_get_contents ($ url); preg_match (dividresultStats [
The code is as follows:
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 ('/
[\ S \ s]. * /Ui ', $ html, $ index );
For ($ I = 0; $ I <= strlen ($ index ['0']); $ I ++ ){
If (is_numeric ($ index ['0'] [$ I]) {
$ Count. = $ index ['0'] [$ I];
}
}
Return $ count;
}
The http://www.bkjia.com/PHPjc/745208.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/745208.htmlTechArticle code is as follows: function get_index ($ domain) {$ url = "http://www.google.com/search? Source = hpbih = 762aq = faql = $ html = file_get_contents ($ url); preg_match ('/p id = resultStats [\...