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, 17 May 2013

view this page in

SplFileObject::fgets

(PHP 5 >= 5.1.0)

SplFileObject::fgetsGets line from file

Descrierea

public string SplFileObject::fgets ( void )

Gets a line from the file.

Parametri

Această funcție nu are parametri.

Valorile întoarse

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

Erori/Excepții

Throws a RuntimeException if the file cannot be read.

Exemple

Example #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();
}
?>

Vedeți de asemenea



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