SplFileObject::valid

(PHP 5 >= 5.1.0, PHP 7)

SplFileObject::validNot at EOF

说明

public SplFileObject::valid ( void ) : bool

Check whether EOF has been reached.

参数

此函数没有参数。

返回值

Returns TRUE if not reached EOF, FALSE otherwise.

范例

Example #1 SplFileObject::valid() example

<?php
// Loop over a file, line by line
$file = new SplFileObject("file.txt");
while (
$file->valid()) {
    echo 
$file->fgets();
}
?>

参见

相关文章
php eventhttp sets default callback to handle requests that are not caught by specific callbacksphp mcve 函数 set whether or not to verify the server ssl certificatephp ncurses 函数 delete character at current position move rest of line leftphp pdf 函数 output text at current positionphp sybase 函数 send a sybase query and do not blockphp opcode descriptions and examples is not equalphp mongocollection creates an index on the specified field s if it does not already existphp solrquery returns the treshold frequency at which words will be ignored which do not occur in at least this many docsphp splfileobject seek to a positionphp splfileobject splfileobject does not have childrenphp splfileobject sets flags for the splfileobjectphp splfileobject not at eofphp splheap peeks at the node from the top of the heapphp swffont calculates the width of the given string in this font at full heightphp swfshape draws an arc of radius r centered at the current location from angle startangle to angle endangle measured clockwise from 12 o clockphp swftext returns the ascent of the current font at its current size or 0 if not availablephp swftext returns the descent of the current font at its current size or 0 if not availablephp swftext returns the leading of the current font at its current size or 0 if not availablephp swoole lock try to acquire the lock and return straight away even the lock is not available.php swoole server delay execution of the callback function at the end of current eventloop.
关注编程学问公众号