-
Notifications
You must be signed in to change notification settings - Fork 1
Stream: write Example
Terry L edited this page Jun 20, 2020
·
2 revisions
Shieldon\Psr7\Stream
-
param
string
string*
The string that is to be written. -
return
int
Returns the number of bytes written to the stream.
Example:
$stream = new Stream(fopen('php://temp', 'r+'));
$stream->write('Foo Bar');
echo $stream->getContents();
// Outputs: Foo Bar
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.