downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

SplFileObject::fgetss> <SplFileObject::fgetcsv
[edit] Last updated: Fri, 24 May 2013

view this page in

SplFileObject::fgets

(PHP 5 >= 5.1.0)

SplFileObject::fgetsЧитает строку из файла

Описание

public string SplFileObject::fgets ( void )

Читает строку из файла.

Список параметров

У этой функции нет параметров.

Возвращаемые значения

Возвращает строку, содержащую следующую строку из файла, или FALSE в случае ошибки.

Ошибки

Выбрасывает RuntimeException, если файл не может быть прочитан.

Примеры

Пример #1 Пример использования SplFileObject::fgets()

Этот пример построчно выводит содержимое file.txt.

<?php
$file 
= new SplFileObject("file.txt");
while (!
$file->eof()) {
    echo 
$file->fgets();
}
?>

Смотрите также



add a note add a note User Contributed Notes SplFileObject::fgets - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites