我有一个这样的页面 http://abc.php
网友是从百度搜索 国家 我网站排在第三名,
所以网友就进我们网站了
现:我能得到 网友进我们网站的来源页面,
问 如何得到 网友在百度中输入的关键词(国家)呢,
在线等,多谢大家
网友是从百度搜索 国家 我网站排在第三名,
所以网友就进我们网站了
现:我能得到 网友进我们网站的来源页面,
问 如何得到 网友在百度中输入的关键词(国家)呢,
在线等,多谢大家
解决方案 »
- php生成的xml如何在不关闭浏览器(ie)的情况下,让ie读取每次生成xml
- vs.php的运行问题!在线等
- 请问怎么才能得到当前html的地址,实现浏览次数功能??
- 安装PHPMYADMIN老出错,不知为什么??
- PHP 5.3 能用在正式场合吗?稳定吗
- 今天刚领了营业执照,散点分
- smarty中如何调用javascript函数
- 怎么所有的extension都不能用了
- 用PHP能实现文本及图片等数据的打印功能吧?如何来实现呢?
- 可以显示数据库中的数据,单独插入可以执行,但是IF插入就无法执行了!
- mb_convert_encoding空格就成了问号
- php snoopy采集遇到的问题 :bad request your browser sent a request that this server could not understand
你能得到上一個頁面的url但是你能得到百度的url???
{
$gather_url="http://www.baidu.com/s?wd=%CF%F3%BA%FE2008&tn=ylmf_3_pg&ch=23";
$has_cn= (preg_match('/baidu.com+/',$gather_url) ?'':'不').'存在';
if($has_cn=='存在')
{
$html = @file_get_contents($gather_url);
$table = preg_replace("'<table[^>]*?>'si","",$html);
$table = preg_replace("'<tr[^>]*?>'si","",$table);
$table = preg_replace("'<td[^>]*?>'si","",$table);
$table = str_replace("</tr>","{tr}",$table);
$table = str_replace("</td>","{td}",$table);
//去掉 HTML 标记
$table = preg_replace("'<[\/\!]*?[^<>]*?>'si","",$table);
//去掉空白字符
$table = preg_replace("'([\r\n])[\s]+'","",$table);
$table = str_replace(" ","",$table);
$table = str_replace(" ","",$table);
if($table)
{
$table = explode('body', $table);
$table = explode('_', $table[0]);
}
echo $table[1];
}
}
gather_key_content();