您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

PHP获取百度关键词排名

2025/6/28 17:10:21发布17次查看
跳至                     [1]                         [2]                         [3]     [全屏预览]
@$k=$_get['k'] ? $_get['k'] : '不念博客'; @$u=$_get['u'] ? $_get['u'] : 'www.bunian.cn'; $rn='50'; $url = "https://www.baidu.com/s?ie=utf-8&wd=".$k."&rn=".$rn; $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_header, false); curl_setopt($ch, curlopt_returntransfer, true); curl_setopt($ch, curlopt_ssl_verifypeer, false); curl_setopt($ch, curlopt_useragent, 'mozilla/5.0 (windows nt 6.1) applewebkit/537.11 (khtml, like gecko) chrome/23.0.1271.1 safari/537.11'); $res = curl_exec($ch); $rescode = curl_getinfo($ch, curlinfo_http_code); curl_close($ch); preg_match_all('/(.*?)/si', $res, $p); for ($ii = 0; $ii < count($p[1]); $ii++){ $pos=strpos($p[1][$ii],$u); if(is_integer($pos)){ $rn= $ii+1; break; } } echo $rn;
2. [代码][php]代码 跳至 [1] [2] [3] [全屏预览] 欢迎大家来我的博客做客
3. [代码][php]代码     跳至                     [1]                         [2]                         [3]     [全屏预览]
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product