English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The readfile() function can read a file and write it to the output buffer. If successful, this function can return the number of bytes read; if failed, it returns false and an error. We can hide the error output by adding a "@" symbol before the function name.
int readfile ( string $filename [, bool $use_include_path = FALSE [, resource $context ]] )
This function can read a file and write it to the output buffer. If the fopen() function wrapper is enabled in the php.ini file, the URL of this function can be used as the filename.
<?php echo readfile("/PhpProject/sample.txt"); ?>
Output Result
w3codebox Tutorix 23PHP Filesystem Reference Manual