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; } } |