SplTempFileObject::__construct

(PHP 5 >= 5.1.2, PHP 7) Construct a new temporary file object public SplTempFileObject::__construct ([ int $max_memory ] ) Construct a new temporary file object. Parameters: max_memory The maximum amount of memory (in bytes, default is 2 MB) for the temporary file to use. If the temporary file exceeds this size, it will be moved to a file in the system's temp directory

SplFileObject::valid

(PHP 5 >= 5.1.0, PHP 7) Not at EOF public bool SplFileObject::valid ( void ) Check whether EOF has been reached. Returns: Returns TRUE if not reached EOF, FALSE otherwise. Examples: SplFileObject::valid() example <?php // Loop over a file, line by line $file = new SplFileObject("file.txt"); while ($file->valid())

SplFileObject::__toString

(PHP 5 >= 5.1.0, PHP 7) Alias of SplFileObject::current() public void SplFileObject::__toString ( void ) This method is an alias of SplFileObject::current().

SplFileObject::setMaxLineLen

(PHP 5 >= 5.1.0, PHP 7) Set maximum line length public void SplFileObject::setMaxLineLen ( int $max_len ) Sets the maximum length of a line to be read. Parameters: max_len The maximum length of a line. Returns: No value is returned. Exception: Throws DomainException when max_len is less than zero.

SplFileObject::setFlags

(PHP 5 >= 5.1.0, PHP 7) Sets flags for the SplFileObject public void SplFileObject::setFlags ( int $flags ) Sets the flags to be used by the SplFileObject. Parameters: flags Bit mask of the flags to set. See SplFileObject constants for the available flags. Returns: No value is returned. Exampl

SplFileObject::setCsvControl

(PHP 5 >= 5.2.0, PHP 7) Set the delimiter and enclosure character for CSV public void SplFileObject::setCsvControl ([ string $delimiter = "," [, string $enclosure = "\"" [, string $escape = "\\" ]]] ) Sets the delimiter and enclosure character for parsing CSV fields. Parameters: delimiter The field delimiter (one character only). enclosure

SplFileObject::seek

(PHP 5 >= 5.1.0, PHP 7) Seek to specified line public void SplFileObject::seek ( int $line_pos ) Seek to specified line in the file. Parameters: line_pos The zero-based line number to seek to. Returns: No value is returned. Exception: Throws a LogicException if the line_pos is negative.

SplFileObject::rewind

(PHP 5 >= 5.1.0, PHP 7) Rewind the file to the first line public void SplFileObject::rewind ( void ) Rewinds the file back to the first line. Returns: No value is returned. Exception: Throws a RuntimeException if cannot be rewound. Examples: SplFileObject::rewind() example <?php $file = new SplFil

SplFileObject::next

(PHP 5 >= 5.1.0, PHP 7) Read next line public void SplFileObject::next ( void ) Moves ahead to the next line in the file. Returns: No value is returned. Examples: SplFileObject::next() example <?php // Read through file line by line $file = new SplFileObject("misc.txt"); while (!$file->eof()) {     echo $file-&g

SplFileObject::key

(PHP 5 >= 5.1.0, PHP 7) Get line number public int SplFileObject::key ( void ) Gets the current line number. Note: This number may not reflect the actual line number in the file if SplFileObject::setMaxLineLen() is used to read fixed lengths of the file. Returns: Returns the current line number. Examples: SplFileObject::key() e