我的代码在这里
<?php echo (file_get_contents("http://123.com/video/latest.php")); ?>
这是错误如何解决这个问题
警告:file_get_contents(http://123.com/video/latest.php):无法打开流:已达到重定向限制,在第 340 行的/home/123/public_html/index.php 中中止
谢谢。
尝试使用此代码,它不会自动跟随重定向:
$context = stream_context_create(
array(
'http' => array(
'follow_location' => false
)
)
);
$html = file_get_contents('YOUR_URL', false, $context);
另一个问题是您尝试从中获取内容的 URL 返回 404 错误。