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

search for in the

SplFileObject::fgetss> <SplFileObject::fgetcsv
[edit] Last updated: Fri, 23 Mar 2012

view this page in

SplFileObject::fgets

(PHP 5 >= 5.1.0)

SplFileObject::fgetsGets line from file

Opis

public string SplFileObject::fgets ( void )

Gets a line from the file.

Parametry

Ta funkcja nie posiada parametrów.

Zwracane wartości

Returns a string containing the next line from the file, or FALSE on error.

Błędy/Wyjątki

Throws a RuntimeException if the file cannot be read.

Przykłady

Przykład #1 SplFileObject::fgets() example

This example simply outputs the contents of file.txt line-by-line.

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

Zobacz też:



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

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