Skip to content

Stream: getSize Example

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

Shieldon\Psr7\Stream

getSize()

Get the size of the stream if known.

  • return int|null

Example:

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

echo $stream->getSize();
// Outputs: 15166
Clone this wiki locally