Home  >  Article  >  Backend Development  >  PHP batch query Sogou code sharing_PHP tutorial

PHP batch query Sogou code sharing_PHP tutorial

WBOY
WBOYOriginal
2016-07-13 09:53:55936browse

PHP batch query Sogou code sharing

This article shares with you the example code of using PHP to query Sogou in batches. It is very simple and practical. Friends in need can refer to it. Down.

php batch query Sogou sogou's rank, very good, mainly using php's file_get_contents() method.

ใ€€?

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

date_default_timezone_set('Asia/Shanghai');

header('Content-Type: text/html; charset=utf-8');

@$txt = file_get_contents("list.txt" );

$arr = explode("rn" , trim($txt));

if(count($txtarr)<0){

exit('no site');

}

foreach($arr as $v){

$sr=file_get_contents("http://rank.ie.sogou.com/sogourank.php?ur=http://{$v}/");

$sr=str_replace('sogourank=','',$sr);

if($sr>2){

echo $v."
n";

}else{

continue;

}

}

1

2 3

45 6 7 8 9 10
11
12
13 14 15 16 17 18 19 20
<๐ŸŽœ>date_default_timezone_set('Asia/Shanghai');<๐ŸŽœ> <๐ŸŽœ>header('Content-Type: text/html; charset=utf-8');<๐ŸŽœ> <๐ŸŽœ> <๐ŸŽœ> <๐ŸŽœ>@$txt = file_get_contents("list.txt" );<๐ŸŽœ> <๐ŸŽœ>$arr = explode("rn" , trim($txt));<๐ŸŽœ> <๐ŸŽœ> <๐ŸŽœ> <๐ŸŽœ>if(count($txtarr)<0){<๐ŸŽœ> <๐ŸŽœ>exit('no site');<๐ŸŽœ> <๐ŸŽœ>}<๐ŸŽœ> <๐ŸŽœ> <๐ŸŽœ> <๐ŸŽœ>foreach($arr as $v){<๐ŸŽœ> <๐ŸŽœ>$sr=file_get_contents("http://rank.ie.sogou.com/sogourank.php?ur=http://{$v}/");<๐ŸŽœ> <๐ŸŽœ>$sr=str_replace('sogourank=','',$sr);<๐ŸŽœ> <๐ŸŽœ>if($sr>2){ echo $v."
n"; }else{ continue; } }
The above is the entire content of this article, I hope you all like it. http://www.bkjia.com/PHPjc/1000066.htmlwww.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1000066.htmlTechArticlephp Batch Query Sogou Sogou Code Sharing This article will share with you an example code for batch querying Sogou using PHP. It is very It's simple and practical, friends in need can refer to it. ...
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