English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Filesystem Reference Manual
The fpassthru() function can read all data from the opened file from the current position until EOF and write the result to the output buffer. This function can return the number of characters passed, or false on failure.
int fpassthru ( resource $handle )
When using the fpassthru() function with binary files on Windows systems, the file must be opened in binary mode.
<?php $file = fopen("sample.txt", "r"); //Read the first line fgets($file); //Send the remaining part of the file to the output buffer echo fpassthru($file); fclose($file); ?>
Output Result
Tutorix7