Skip to content

Stream: isSeekable Example

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

Shieldon\Psr7\Stream

isSeekable()

Seek to a position in the stream.

  • return bool

Example:

$resource = fopen(BOOTSTRAP_DIR . '/sample/shieldon_logo.png', 'r+');
$stream = new \Shieldon\Psr7\Stream($resource);

if ($stream->isSeekable()) {
    echo 'File is seekable';
}
// Outputs: File is seekable