![]() |
The SplFileObject::fseek() function is an inbuilt function of Standard PHP Library (SPL) in PHP that allows you to move the file pointer to a specified position within a file opened using Syntax: public SplFileObject::fseek(int $offset, int $whence = SEEK_SET): int
Parameters: This function accepts two parameters that are described below.
Program 1: The following program demonstrates the SplFileObject::fseek() function. Save this file name as “output.txt” before running this program. Line 1: This is the first line of data. PHP
Output: is is the first line of data. Program 2: The following program demonstrates the SplFileObject::fseek() function. Save this file name as “output.txt” before running this program. Ram PHP
Output: The third name in the file is: Johnson
Reference: https://www.php.net/manual/en/splfileobject.fseek.php |
Reffered: https://www.geeksforgeeks.org
PHP |
Related |
---|
![]() |
![]() |
![]() |
![]() |
![]() |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 10 |