PHP文件无法读取某些URL

时间:2019-01-23 21:31:57

标签: file url

我有这样的代码:

<?php
echo '<br><br>';
$context = stream_context_create(
array(
    'http' => array(
        'user_agent' => 'Mozilla/5.0 (Windows NT 10.0; WOW64) 
AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36',                       
    )
)
);

$upfile_seek= 'http://www.eliteprospects.com/iframe_player_stats.php? 
player=4567';
// $upfile_seek= 'https://en.wikipedia.org/wiki/Main_Page';
echo $upfile_seek.'<br><br>';  

$orders= file($upfile_seek, false, $context);    
$number_of_orders = count($orders);

echo $number_of_orders.'<br><br>';
for ($i=0; $i<$number_of_orders; $i++)
{       
$show_line = htmlentities($orders[$i],ENT_COMPAT | ENT_HTML401, 'windows- 
1250');
$show_line = iconv('UTF-8', 'windows-1250', $show_line).'<br />';
echo $show_line.'<br>';
}        
?>

最后我能看到的是

** http://www.eliteprospects.com/iframe_player_stats.php?player=4567

1 **

但是当我使用Wikipedia链接时,它向我展示了更多。问题出在哪里?

0 个答案:

没有答案