No cache version.
Caching disabled. Default setting for this page:enabled (code LNG204)If the display is too slow, you can disable the user mode to view the cached version.
The SplFileObject class
(PHP 5 >= 5.1.0, PHP 7)
Introduction
The SplFileObject class offers an object oriented interface for a file.
Class synopsis
/* Constants */
/* Methods */
public __construct
( string
$filename
[, string $open_mode
= "r"
[, bool $use_include_path
= FALSE
[, resource $context
]]] )
public fgetcsv
([ string
$delimiter
= ","
[, string $enclosure
= "\""
[, string $escape
= "\\"
]]] ) : array
public fputcsv
( array
$fields
[, string $delimiter
= ","
[, string $enclosure
= '"'
[, string $escape
= "\\"
]]] ) : int
public setCsvControl
([ string
$delimiter
= ","
[, string $enclosure
= "\""
[, string $escape
= "\\"
]]] ) : void/* Inherited methods */
public SplFileInfo::openFile
([ string
}$open_mode
= "r"
[, bool $use_include_path
= FALSE
[, resource $context
= NULL
]]] ) : SplFileObjectPredefined Constants
SplFileObject::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.
Table of Contents
- SplFileObject::__construct — Construct a new file object
- SplFileObject::current — Retrieve current line of file
- SplFileObject::eof — Reached end of file
- SplFileObject::fflush — Flushes the output to the file
- SplFileObject::fgetc — Gets character from file
- SplFileObject::fgetcsv — Gets line from file and parse as CSV fields
- SplFileObject::fgets — Gets line from file
- SplFileObject::fgetss — Gets line from file and strip HTML tags
- SplFileObject::flock — Portable file locking
- SplFileObject::fpassthru — Output all remaining data on a file pointer
- SplFileObject::fputcsv — Write a field array as a CSV line
- SplFileObject::fread — Read from file
- SplFileObject::fscanf — Parses input from file according to a format
- SplFileObject::fseek — Seek to a position
- SplFileObject::fstat — Gets information about the file
- SplFileObject::ftell — Return current file position
- SplFileObject::ftruncate — Truncates the file to a given length
- SplFileObject::fwrite — Write to file
- SplFileObject::getChildren — No purpose
- SplFileObject::getCsvControl — Get the delimiter, enclosure and escape character for CSV
- SplFileObject::getCurrentLine — Alias of SplFileObject::fgets
- SplFileObject::getFlags — Gets flags for the SplFileObject
- SplFileObject::getMaxLineLen — Get maximum line length
- SplFileObject::hasChildren — SplFileObject does not have children
- SplFileObject::key — Get line number
- SplFileObject::next — Read next line
- SplFileObject::rewind — Rewind the file to the first line
- SplFileObject::seek — Seek to specified line
- SplFileObject::setCsvControl — Set the delimiter, enclosure and escape character for CSV
- SplFileObject::setFlags — Sets flags for the SplFileObject
- SplFileObject::setMaxLineLen — Set maximum line length
- SplFileObject::__toString — Alias of SplFileObject::fgets
- SplFileObject::valid — Not at EOF
Can not display this page of the Infobrol website
Type of error (18-01)
Unknown format specifier "&"Please try again in a few minutes…
Steph