PHP Australia Conference 2015

SplFileObject::fgets

(PHP 5 >= 5.1.0)

SplFileObject::fgetsGets line from file

Açıklama

public string SplFileObject::fgets ( void )

Gets a line from the file.

Değiştirgeler

Bu işlevin değiştirgesi yoktur.

Dönen Değerler

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

Hatalar/İstisnalar

Throws a RuntimeException if the file cannot be read.

Örnekler

Örnek 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();
}
?>

Ayrıca Bakınız

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top