streamWrapper::stream_eof()
(PHP 4 >= 4.3.2, PHP 5, PHP 7)
Tests for end-of-file on a file pointer
说明
public streamWrapper::stream_eof(void): bool
This method is called in response tofeof().
参数
此函数没有参数。
返回值
Should returnTRUE
if the read/write position is at the end of the stream and if no more data is available to be read,orFALSE
otherwise.
注释
WarningWhen reading the whole file (for example,withfile_get_contents()), PHP will callstreamWrapper::stream_read()followed bystreamWrapper::stream_eof()in a loop but as long asstreamWrapper::stream_read()returns a non-empty string, the return value ofstreamWrapper::stream_eof()is ignored.
参见
feof()
测试文件指针是否到了文件结束的位置