readfile

int readfile(string filename) 

Send the contents of a file to stdout

Returns:

Bytes read; FALSE on error

Description:

readfile() outputs the contents of a file directly to standard output. If PHP has been configured to be URL-aware, prefixing the filename with either http:// or ftp:// opens a connection to the specified URL. Note that since the PHP URL wrappers don’t support redirects, you have to append a trailing slash to directories. FTP connections must be made to servers with support for passive mode transfers.

Warning:

Because some of the filesystem functions to read/write from files partially share the same code, one or more of the bugs reported elsewhere may also apply to this function.

3.0.8: Crashes when used with URLs on ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.