![]() |
The SplFileObject::fflush() function is an inbuilt function in the Standard PHP Library (SPL) in PHP that is used to flush the output buffer of the file. Syntax: public SplFileObject::fflush():bool
Parameter: This function does not accept any parameters. Return Value: The SplFileObject::fflush() function returns “true” if the function successfully flushes the output buffer of the file otherwise, this function will return “false”. Program 1: The following program demonstrates the SplFileObject::flush() function. The “output.txt” should be available in the same folder. PHP
Output: Data flushed successfully to the file.
Program 2: The following program demonstrates SplFileObject::flush() function. The “output.txt” should be available in the same folder. PHP
Output: Data flushed successfully for line: Line 1: This is the first line of data. Reference: https://www.php.net/manual/en/splfileobject.fflush.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 15 |