The SplFileObject class
Guide
Edit on GitHub ✎
The SplFileObject class offers an object-oriented interface for a file.
Intro
The SplFileObject class offers an object-oriented interface for a file.
Class synopsis
class SplFileObject extends SplFileInfo implements RecursiveIterator implements SeekableIterator { }
Predefined Constants
SplFileObject::DROP_NEW_LINEDrop newlines at the end of a line.
SplFileObject::READ_AHEADRead on rewind/next.
SplFileObject::SKIP_EMPTYSkips empty lines in the file. This requires the
READ_AHEADflag be enabled, to work as expected.SplFileObject::READ_CSVRead lines as CSV rows.
Changelog
| Version | Description |
|---|
Splfileobject