Skip to content

Stream: tell Example

Terry L edited this page Jun 20, 2020 · 2 revisions

Shieldon\Psr7\Stream

tell()

Returns the current position of the file read/write pointer

  • return int Position of the file pointer
$resource = fopen(BOOTSTRAP_DIR . '/sample/shieldon_logo.png', 'r+');
$stream = new Stream($resource);

$stream->seek(10);
echo $stream->tell();
// Outputs: 10

$stream->rewind();
echo $stream->tell();
// Outputs: 0

$stream->close();
Clone this wiki locally