Skip to content

Stream: isReadable Example

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

Shieldon\Psr7\Stream

isReadable()

Returns whether or not the stream is readable.

  • return bool

Example:

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

if ($stream->isReadable()) {
    echo 'File is readable';
}
// Outputs: File is readable
Clone this wiki locally