SplFileObject::current

(PHP 5 >= 5.1.0, PHP 7) Retrieve current line of file public string|array SplFileObject::current ( void ) Retrieves the current line of the file. Returns: Retrieves the current line of the file. If the SplFileObject::READ_CSV flag is set, this method returns an array containing the current line parsed as CSV data. Examples: SplFile

SplFileObject::__construct

(PHP 5 >= 5.1.0, PHP 7) Construct a new file object. public SplFileObject::__construct ( string $filename [, string $open_mode = "r" [, bool $use_include_path = false [, resource $context ]]] ) Construct a new file object. Parameters: filename The file to read. TipA URL can be used as a filename with this function if the fopen wrappers have been enabled. See fopen() for more details

SplFileObject::fflush

(PHP 5 >= 5.1.0, PHP 7) Flushes the output to the file public bool SplFileObject::fflush ( void ) Forces a write of all buffered output to the file. Returns: Returns TRUE on success or FALSE on failure. Examples: SplFileObject::fflush() example <?php $file = new SplFileObject('misc.txt', 'r+'); $file->rewind(); $

SplFileInfo::__toString

(PHP 5 >= 5.1.2, PHP 7) Returns the path to the file as a string public void SplFileInfo::__toString ( void ) This method will return the file name of the referenced file. Returns: Returns the path to the file. Examples: SplFileInfo::__toString() example <?php $info = new SplFileInfo('foo'); var_dump($info->__to

SplFileObject::eof

(PHP 5 >= 5.1.0, PHP 7) Reached end of file public bool SplFileObject::eof ( void ) Determine whether the end of file has been reached Returns: Returns TRUE if file is at EOF, FALSE otherwise. Examples: SplFileObject::eof() example <?php $file = new SplFileObject("fruits.txt"); while ( ! $file->eof()) {     echo 

SplFileInfo::openFile

(PHP 5 >= 5.1.2, PHP 7) Gets an SplFileObject object for the file public SplFileObject SplFileInfo::openFile ([ string $open_mode = "r" [, bool $use_include_path = false [, resource $context = NULL ]]] ) Creates an SplFileObject object of the file. This is useful because SplFileObject contains additional methods for manipulating the file whereas SplFileInfo is only useful for gaining information, like whether the file

SplFileInfo::isReadable

(PHP 5 >= 5.1.2, PHP 7) Tells if file is readable public bool SplFileInfo::isReadable ( void ) Check if the file is readable. Returns: Returns TRUE if readable, FALSE otherwise. Examples: SplFileInfo::isReadable() example <?php $info = new SplFileInfo(__FILE__); var_dump($info->isReadable()); $info = new SplFile

SplFileInfo::isLink

(PHP 5 >= 5.1.2, PHP 7) Tells if the file is a link public bool SplFileInfo::isLink ( void ) Use this method to check if the file referenced by the SplFileInfo object is a link. Returns: Returns TRUE if the file is a link, FALSE otherwise. Examples: SplFileInfo::isLink() example <?php $info = new SplFileInfo('/path/

SplFileInfo::setInfoClass

(PHP 5 >= 5.1.2, PHP 7) Sets the class used with SplFileInfo::getFileInfo() and SplFileInfo::getPathInfo() public void SplFileInfo::setInfoClass ([ string $class_name = "SplFileInfo" ] ) Use this method to set a custom class which will be used when SplFileInfo::getFileInfo() and SplFileInfo::getPathInfo() are called. The class name passed to this method must be SplFileInfo or a class derived from SplFileInfo.

SplFileInfo::isWritable

(PHP 5 >= 5.1.2, PHP 7) Tells if the entry is writable public bool SplFileInfo::isWritable ( void ) Checks if the current entry is writable. Returns: Returns TRUE if writable, FALSE otherwise;