略微加速

PHP官方手册 - 互联网笔记

PHP - Manual: streamWrapper::stream_eof

2024-11-13

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

说明

public streamWrapper::stream_eof(): bool

This method is called in response to feof().

参数

此函数没有参数。

返回值

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.

参见

  • feof() - 测试文件指针是否到了文件结束的位置
add a noteadd a note

User Contributed Notes

There are no user contributed notes for this page.

官方地址:https://www.php.net/manual/en/streamwrapper.stream-eof.php

北京半月雨文化科技有限公司.版权所有 京ICP备12026184号-3