![]() |
The SplFileObject::next() is an inbuilt function in PHP that is used to iterate the file using the SplFileObject. The pointer will point next line. The SplFileObject implements Iterator and Traversal. That means you can use it in foreach loops and use many of the iterator functions with it. Syntaxpublic void SplFileObject::next ( void ) ParameterThis function does not accept any parameters. Return ValueThis function does not return any value. Program 1: The following program demonstrates the SplFileObject::next() function. Save this text in the “output.txt” file in the current working directory before running this program. Hey GeeksforGeeks PHP
Output: Hey GeeksforGeeks Program 2: The following program demonstrates the SplFileObject::next() function. Save this text in the “output.txt” file in the current working directory before running this program. Hello This is a Simple example Another example here. PHP
Output: Simple example Another example here. Reference: https://www.php.net/manual/en/splfileobject.next.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 12 |