|
SplFileObject::fgetcsv(PHP 5 >= 5.1.0) SplFileObject::fgetcsv — Gets line from file and parse as CSV fields Описание
public array SplFileObject::fgetcsv
([ string $delimiter = ","
[, string $enclosure = "\""
[, string $escape = "\\"
]]] )
Gets a line from the file which is in CSV format and returns an array containing the fields read. Список параметров
Возвращаемые значенияReturns an indexed array containing the fields read, or FALSE on error.
Примеры
Пример #1 SplFileObject::fgetcsv() example
<?php
Пример #2 SplFileObject::READ_CSV example
<?php Contents of animals.csv crocodile,reptile,4 dolphin,mammal,0 duck,bird,2 koala,mammal,4 salmon,fish,0 Результатом выполнения данного примера будет что-то подобное: 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 Смотрите также
|
|