Home >Backend Development >PHP Tutorial >php-关于用file()读取url的疑问

php-关于用file()读取url的疑问

WBOY
WBOYOriginal
2016-06-02 11:33:411208browse

php

<code> $buffer = file("http://www.sina.com.cn");for($i=0;$i<sizeof echo></sizeof></code>

读取新浪没问题,
但是读163的话,就提示:
因为您的ISP供应商并没有遵循标准的互联网协议,我们对您的访问作出限制,敬请谅解。 您可以通过以下链接继续访问 www.163.com

而读取豆瓣,就报warning:

Warning: file(http://www.douban.com) [function.file]: failed to open stream: HTTP request failed! HTTP/1.1 403 Forbidden in C:\wamp\www\1\1.php on line 25

读搜狐就全是乱码

这是怎么回事?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn