A little clarification about what you get when you read from an

fopen'd http:// URL.


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@50904 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Ken Coar 2001-07-08 13:37:39 +00:00
parent 9033afe45d
commit 860f5c5163

View file

@ -1140,10 +1140,16 @@ $fcontents = join ('', file ('http://www.php.net'));
<simpara>
If <parameter>filename</parameter> begins with "http://" (not
case sensitive), an HTTP 1.0 connection is opened to the
specified server and a file pointer is returned to the beginning
of the text of the response. A 'Host:' header is sent with the
specified server, the page is requested using the HTTP GET
method, and a file pointer is returned to the beginning
of the body of the response. A 'Host:' header is sent with the
request in order to handle name-based virtual hosts.
</simpara>
<simpara>
Note that the file pointer allows you to retrieve only the
<emphasis>body</emphasis> of the response; you cannot
access the HTTP response header using this function.
</simpara>
<simpara>
Versions prior to PHP 4.0.5 do not handle HTTP redirects. Because
of this, directories must include trailing slashes.