-
Notifications
You must be signed in to change notification settings - Fork 2
Stream: eof Example
Terry L edited this page Jun 20, 2020
·
2 revisions
Shieldon\Psr7\Stream
Returns true if the stream is at the end of the stream.
-
return
bool
$resource = fopen(BOOTSTRAP_DIR . '/sample/shieldon_logo.png', 'r+');
$stream = new Stream($resource);
$stream->seek(10);
if ($stream->eof()) {
echo 'The position of the file pointer of the stream is at the end.';
} else {
echo 'Not at the end.';
}
// Outputs: Not at the end.
$stream->seek(15166);
if ($stream->eof()) {
echo 'The position of the file pointer of the stream is at the end.';
} else {
echo 'Not at the end.';
}
// Outputs: The position of the file pointer of the stream is at the end.
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.