本来应该没什么问题的,但奇怪的是打开这个页面的时候,就会跳转到http://sina.com.cn .
而且,当我换着$start_str和$end_str是其他内容的时候,有时候会跳转,有时候不会.
另外,我把http://sina.com.cn源文件保存后,$url在指向本地的该源文件的时候,却不会跳转.请问,这是什么原因,是一种技术么?<?
$url = "http://sina.com.cn";
$start_str='<!--此部分为新浪首页要闻区内容-->';
$end_str='</ul>';
//$start_str='<!-- 博客图文 begin -->';
//$end_str='<!-- 博客图文 end -->';
echo get_link($url,$start_str,$end_str);function get_link($url,$start,$end)
{
$content = file_get_contents($url);
$start_position=strpos($content,$start);
$content=substr($content,$start_position);
$start_position=strpos($content,">")+1;
$end_position=strpos($content,$end);
$length=$end_position-$start_position;
$content=substr($content,$start_position,$length);
return $content;
}
?>
而且,当我换着$start_str和$end_str是其他内容的时候,有时候会跳转,有时候不会.
另外,我把http://sina.com.cn源文件保存后,$url在指向本地的该源文件的时候,却不会跳转.请问,这是什么原因,是一种技术么?<?
$url = "http://sina.com.cn";
$start_str='<!--此部分为新浪首页要闻区内容-->';
$end_str='</ul>';
//$start_str='<!-- 博客图文 begin -->';
//$end_str='<!-- 博客图文 end -->';
echo get_link($url,$start_str,$end_str);function get_link($url,$start,$end)
{
$content = file_get_contents($url);
$start_position=strpos($content,$start);
$content=substr($content,$start_position);
$start_position=strpos($content,">")+1;
$end_position=strpos($content,$end);
$length=$end_position-$start_position;
$content=substr($content,$start_position,$length);
return $content;
}
?>
北京放宽未成年子女随父落户条件 推户籍新举措
邯郸银行盗窃案疑犯花4300万买彩票 3人举报
辽宁钢厂死者身份靠DNA辨认 赔偿标准初定27万
外交部证实东突分子玉山江一审被判无期徒刑
辽宁公安厅为派出所换发二代证乱收费道歉
美国枪击案死亡学生将被追授学位 图集 视频
六家银行今起叫停跨行查询收费
专题:上海车展开幕 滚动新闻 新车图 模特图
奥运火炬传递路线月底公布 奥组委希望经过台湾
北京法院首次将道德调查纳入量刑参考
西班牙华人被殴打勒索事件多数受害人拒绝作证
沈阳运钞员打死顾客调查:短期培训即持枪存隐患
网友热评方永刚精神 学生期盼不受网络色情侵害
博客:金庸 鼠尾草 陈明 王孺童 罗志祥 腾格尔
新浪乐库:陈奕迅 陈升 阿牛 王啸坤 无印良品
20日开运专家聊民俗 锐话题之大学生应聘搓澡工