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

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

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-02 11:33:41
Original
1218 people have browsed it

php

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

读取新浪没问题,
但是读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

读搜狐就全是乱码

这是怎么回事?

Related labels:
php
source:php.cn
Statement of this Website
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
Latest Issues
php data acquisition?
From 1970-01-01 08:00:00
0
0
0
PHP extension intl
From 1970-01-01 08:00:00
0
0
0
How to learn php well
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template