![]() |
The SplFileObject::fpassthru() is an inbuilt function in PHP that is used to output the contents of a file to the output buffer, typically the browser, without reading the entire file into memory. It allows you to efficiently stream the contents of a file in smaller chunks, which is particularly useful for working with large files. Syntax: public SplFileObject::fpassthru(): int
Parameters: This function does not have any parameters. Return Value: This function returns the number of characters from the buffer. Program 1: The following program demonstrates SplFileObject::fpassthru() function. Note: Before running this program save this file as “data.txt” John,Doe,25
PHP
Output: John,Doe,25 Program 2: The following program demonstrates SplFileObject::fpassthru() function. PHP
Output: hey Geeks for Geeks
Reference: https://www.php.net/manual/en/splfileobject.fpassthru.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 11 |