readfile

readfile -- Outputs a file

Description

int readfile ( string filename [, int use_include_path])

Reads a file and writes it to standard output .

If filename begins with " http : / / " (not case sensitive ) , an HTTP 1.0 connection is opened to the specified server and the text of the response is written to standard output .

Versions prior to PHP 4.0.5 do not handle HTTP redirects . Because of this , directories must include trailing slashes .

If filename begins with " ftp : / / " (not case sensitive ) , an ftp connection to the specified server is opened and the requested file is written to standard output . If the server does not support passive mode ftp , this will fail .

If filename begins with neither of these strings , the file will be opened from the filesystem and its contents written to standard output .

See also fpassthru( ) , file( ) , fopen( ) , include( ) , require( ) , and virtual( ) .