array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'class.splfileobject.php', 1 => 'SplFileObject', ), 'up' => array ( 0 => 'spl.files.php', 1 => 'Dosya İşleme', ), 'prev' => array ( 0 => 'splfileinfo.tostring.php', 1 => 'SplFileInfo::__toString', ), 'next' => array ( 0 => 'splfileobject.construct.php', 1 => 'SplFileObject::__construct', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/spl/splfileobject.xml', ), 'extra_header_links' => array ( 'rel' => 'alternate', 'href' => '/manual/en/feeds/class.splfileobject.atom', 'type' => 'application/atom+xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 5 >= 5.1.0, PHP 7, PHP 8)
The SplFileObject class offers an object-oriented interface for a file.
$filename
,$mode
= "r",$useIncludePath
= false
,$context
= null
$separator
= ",", string $enclosure
= "\"", string $escape
= "\\"): array|false$fields
,$separator
= ",",$enclosure
= "\"",$escape
= "\\",$eol
= "\n"$separator
= ",", string $enclosure
= "\"", string $escape
= "\\"): void$mode
= "r", bool $useIncludePath
= false
, ?resource $context
= null
): SplFileObjectSplFileObject::DROP_NEW_LINE
Drop newlines at the end of a line.
SplFileObject::READ_AHEAD
Read on rewind/next.
SplFileObject::SKIP_EMPTY
Skips empty lines in the file. This requires the READ_AHEAD
flag be enabled, to work as expected.
SplFileObject::READ_CSV
Read lines as CSV rows.