Php/docs/splfileobject.next

提供:Dev Guides
< Php
移動先:案内検索

SplFileObject::next

(PHP 5 >= 5.1.0, PHP 7)

SplFileObject::next次の行を読み出す


説明

public SplFileObject::next ( ) : void

ファイルの次の行に進みます。


パラメータ

この関数にはパラメータはありません。


返り値

値を返しません。


例1 SplFileObject::next() の例

<?php// 行単位でファイルを読み込む$file = new SplFileObject("misc.txt");while (!$file->eof()) {    echo $file->current();    $file->next();}?>

参考