streamWrapper::stream_eof

(PHP 4 >= 4.3.2, PHP 5, PHP 7, PHP 8)

streamWrapper::stream_eofTests for end-of-file on a file pointer

說(shuō)明

public streamWrapper::stream_eof(): bool

This method is called in response to feof().

參數(shù)

此函數(shù)沒(méi)有參數(shù)。

返回值

Should return true if the read/write position is at the end of the stream and if no more data is available to be read, or false otherwise.

注釋

警告

When reading the whole file (for example, with file_get_contents()), PHP will call streamWrapper::stream_read() followed by streamWrapper::stream_eof() in a loop but as long as streamWrapper::stream_read() returns a non-empty string, the return value of streamWrapper::stream_eof() is ignored.

參見(jiàn)

  • feof() - 測(cè)試文件指針是否到了文件結(jié)束的位置