PHP3 Manual | ||
---|---|---|
Prev | Next |
fopen -- open file or URL
If filename 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.
Does not handle HTTP redirects, so you must include trailing slashes on directories.
If filename begins with "ftp://" (not case sensitive), an ftp connection to the specified server is opened and a pointer to the requested file is returned. If the server does not support passive mode ftp, this will fail.
If filename begins with anything else, the file will be opened from the filesystem, and a file pointer to the file opened is returned.
If the open fails, the function returns false.
Example 1. fopen() example $fp = fopen( "/home/rasmus/file.txt", "r" ); $fp = fopen( "http://www.php.net/", "r" ); |
See also fclose(), fsockopen(), and popen().
Prev | Home | Next |
filetype | Up | fpassthru |