Home > Article > Backend Development > PHP batch query Sogou code sharing_PHP tutorial
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.
ใ?
2 3 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; } } |