Skip to content

Stream: isWritable Example

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

Shieldon\Psr7\Stream

isWritable()

Write data to the stream.

  • return bool

Example:

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

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