关于读取别人网页的部分内容的问题,高手请进! 用正则~preg_replacepreg_matchpreg_match_all几个函数 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 先用以下的小偷程序得到源代码<?php/*****************函数部分**************************//*获取指定网页的内容$url为网页地址*/function getcontent($url){ if($open=file($url)){ $count=count($open); for($i=0;$i<$count;$i++) { $theget.=$open[$i]; } }else{ die('请求过多,超时,请刷新'); } return $theget; } ?><?php/***********************程序部分**************************/$url="http://www.url.com/judge.jsp?username=admin&password=admin888";getcontent($url);//第一处$url="http://www.url.com/manage.jsp";$gethtml=getcontet($url);echo $gethtml;?>然后用正则preg_match进行查找替换,得到你需要的值 我把你的程序放入我写的一个link_data.php文件中,然后把你提供的网址修改了一下,再运行,得到的结果是:Fatal error: Call to undefined function: getcontet() in d:\appserv\www\link_data.php on line 24请问是什么原因? 楼主好可爱楼上的只是举了个例子,并没有给你全部的代码。getcontent()还是要自己定义的 getcontent()黑翼不是已经写出来了吗 file_get_contents($url);然后正则分析 $file = fopen (网址, "r");while (!feof ($file)) { $line4 = fgets ($file, 1024); if (eregi ("<title>(.*)</title>", $line4, $out4)) { $a = $out4[1]; break; }} 关于ajax的登入判断问题 各位大侠帮个忙 求助个正则表达式 只一行 详细入贴 这个MYSQL语句怎么查不出正确的结果? 用页面或表单传递字符串时的转义符问题 如何搜索出一个表中的数据,并且符合另一个表的条件? 小弟新站(在线MTV)开通,请各位提出意见和测试速度 简体系统与繁体系统传送中文参数的困扰 关于在网页上向服务器端的文件写内容 这个变量如何传递? 判断一个目录是否存在?,怎么办?,和判断文件存在用一个函数吗? 有單子,找會PHP+MYSQL開發人員合作!最好在深圳! 求《smarty中文手册》
<?php
/*****************函数部分**************************/
/*获取指定网页的内容
$url为网页地址
*/
function getcontent($url){
if($open=file($url)){
$count=count($open);
for($i=0;$i<$count;$i++)
{
$theget.=$open[$i];
}
}else{
die('请求过多,超时,请刷新');
}
return $theget;
}
?>
<?php
/***********************程序部分**************************/
$url="http://www.url.com/judge.jsp?username=admin&password=admin888";
getcontent($url);//第一处
$url="http://www.url.com/manage.jsp";
$gethtml=getcontet($url);
echo $gethtml;
?>
然后用正则preg_match进行查找替换,得到你需要的值
Fatal error: Call to undefined function: getcontet() in d:\appserv\www\link_data.php on line 24
请问是什么原因?
while (!feof ($file)) {
$line4 = fgets ($file, 1024);
if (eregi ("<title>(.*)</title>", $line4, $out4)) {
$a = $out4[1];
break;
}
}