-
Notifications
You must be signed in to change notification settings - Fork 1
Stream: read Example
Terry L edited this page Jun 20, 2020
·
2 revisions
Shieldon\Psr7\Stream
Read data from the stream.
-
param
int
length*
Read up to $length bytes from the object and return them. -
return
string
Example:
$stream = new Stream(fopen('php://temp', 'r+'));
$stream->write('Glory to Hong Kong');
echo $stream->read(5);
// Outputs: Glory
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.