PHP
The SplFileObject class
The SplFileObject class
(PHP 5 >= 5.1.0)
Introduction
The SplFileObject class offers an object oriented interface for a file.
Class synopsis
public __construct (
string $filename
[,
string $open_mode
= "r" [,
bool $use_include_path
= false [,
resource $context
]]] )
public string|array current (
void )
public string fgetc (
void )
public array fgetcsv ([
string $delimiter
= "," [,
string $enclosure
= "\"" [,
string $escape
= "\\" ]]] )
public string fgets (
void )
public string fgetss ([
string $allowable_tags
] )
public bool flock (
int $operation
[,
int &$wouldblock
] )
public int fputcsv (
array $fields
[,
string $delimiter
= ',' [,
string $enclosure
= '"' ]] )
public mixed fscanf (
string $format
[,
mixed &$...
] )
public int fseek (
int $offset
[,
int $whence
= SEEK_SET ] )
public array fstat (
void )
public int ftell (
void )
public int fwrite (
string $str
[,
int $length
] )
public void next (
void )
public void seek (
int $line_pos
)
public void setCsvControl ([
string $delimiter
= "," [,
string $enclosure
= "\"" [,
string $escape
= "\\" ]]] )
public bool valid (
void )
public SplFileObject SplFileInfo::openFile ([
string $open_mode
= r [,
bool $use_include_path
= false [,
resource $context
= NULL
]]] )
}
Predefined 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.
SplFileObject::READ_CSV
-
Read lines as CSV rows.
Table of Contents
Content
License.
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 124 / 158766022. Delta: 0.02761 с