-
Notifications
You must be signed in to change notification settings - Fork 2
StreamFactory: createStream Example
Terry L edited this page Jun 21, 2020
·
4 revisions
Shieldon\Psr17\StreamFactory
Create a new stream from a string. The stream will be created with a temporary resource.
-
param
string
content= ""
String content with which to populate the stream. -
return
StreamInterface
Example:
$streamFactory = new StreamFactory();
$stream = $streamFactory->createStream('Foo Bar');
echo $stream;
// Outputs: Foo Bar
composer require shieldon/psr-http
Shieldon PSR HTTP implementation written by Terry L. from Taiwan.