|
SplFileObject::fgetcsvGets line from file and parse as CSV fields Description
public arrayfalse SplFileObject::fgetcsv(string
$separator = ",", string $enclosure = "\"", string $escape = "\\")Gets a line from the file which is in CSV format and returns an array containing the fields read.
Parameters
Warning
When Return Values
Returns an indexed array containing the fields read, or
Changelog
Examples
Example #1 SplFileObject::fgetcsv example
Example #2
Contents of animals.csv crocodile,reptile,4 dolphin,mammal,0 duck,bird,2 koala,mammal,4 salmon,fish,0 The above example will output something similar to: A crocodile is a reptile with 4 legs A dolphin is a mammal with 0 legs A duck is a bird with 2 legs A koala is a mammal with 4 legs A salmon is a fish with 0 legs See Also
|