这段代码能不能把index.php输出?

imdemon 2005-11-26 04:39:36
$file="http://www.sina.com/index.php";
$open=file($file);

$count=count($open);
for($i=0;$i<$count;$i++)
{
$theget.=$open[$i];
}


echo $theget;

大家帮忙看看好么?
...全文
166 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
helloyou0 2005-11-27
  • 打赏
  • 举报
回复
你想输出什么?
helloyou0 2005-11-27
  • 打赏
  • 举报
回复
瞧瞧allow_url_fopen开了没有
imdemon 2005-11-27
  • 打赏
  • 举报
回复
我的目的是把读取到的index.php的HTM文件输出出来,不是输出源代码
julychina 2005-11-26
  • 打赏
  • 举报
回复
这是输入的目标文件吧。而不是源文件
gu1dai 2005-11-26
  • 打赏
  • 举报
回复
$file="http://www.sina.com/index.php";
$get=file_get_contents($file);
echo $get;
ryen_cn 2005-11-26
  • 打赏
  • 举报
回复
没问题
aaabbb456 2005-11-26
  • 打赏
  • 举报
回复
你这样写法没有错,但用 file_get_contents 会更好点
imdemon 2005-11-26
  • 打赏
  • 举报
回复
<?

$file="http://imdemon.512j.com/index.htm";
$get=file_get_contents($file);
echo $get;
?>

我把这段传到我的PHP空间上测试,结果显示的页面源代码为

<HTML></HTML>


何解?
imdemon 2005-11-26
  • 打赏
  • 举报
回复
$file="http://www.sina.com/index.php";
$open=file($file)

$count=count($open);
for($i=0;$i<$count;$i++)
{
$theget.=$open[$i];
}


echo $theget;
这样不行么?错在哪?
目标文件和源文件。。。怎么个理解法?

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧