php传入参数获取关键字热度
<?php // //$txt=file_get_contents("http://www.baidu.com/s?word=苹果互联"); //eregi('"margin-left:120px"(.*)</span></p>', $txt, $newtxt); // //echo $newtxt[1]; // //?> <?php $num=$_GET['serword']; //根据传入参数serword的值,获取百度关键字热度;jinghao.2012-04-16 ?> <?php $url = "http://www.baidu.com/s?word=".$num; //目标站 $fp = @fopen($url, "r") or die("超时"); $fcontents = file_get_contents($url); eregi('"margin-left:120px"(.*)</span></p>', $fcontents, $regs); $regs[1]=str_replace(">","",$regs[1]); $regs[1]=str_replace(',',"",$regs[1]); $regs[1]=str_replace('个',"",$regs[1]); $regs[1]=str_replace('找到相关结果约',"",$regs[1]); echo $regs[1]; ?>
相关推荐
zyyjay 2020-11-09
xuebingnan 2020-11-05
samtrue 2020-11-22
stefan0 2020-11-22
yifangs 2020-10-13
songshijiazuaa 2020-09-24
hebiwtc 2020-09-18
天步 2020-09-17
83911535 2020-11-13
whatsyourname 2020-11-13
zhouyuqi 2020-11-10
Noneyes 2020-11-10
mathchao 2020-10-28
王志龙 2020-10-28
wwwsurfphpseocom 2020-10-28
diskingchuan 2020-10-23
savorTheFlavor 2020-10-23