File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -30,17 +30,24 @@ $request = (new ResponseFactory)->createResponse(200);
3030```
3131
3232### Stream
33+
34+ #### Create Stream from a string
3335``` php
34- // create stream from string
3536$stream = (new StreamFactory)->createStream('Hello World!');
3637echo $stream; // Hello World!
38+ ```
3739
38- // create stream from file
40+ #### Create Stream from a file
41+ ``` php
3942$stream = (new StreamFactory)->createStreamFromFile('/path/file', 'w+');
4043$stream->write('Hello World!);
4144echo $stream; // Hello World!
45+ ```
4246
43- // create stream from resource
44- $resource = fopen('php://temp', 'r+');
47+ #### Create Stream from a resource
48+ ``` php
49+ $resource = fopen('php://temp', 'w+');
4550$stream = (new StreamFactory)->createStreamFromResource($resource);
51+ $stream->write('Hello World!);
52+ echo $stream; // Hello World!
4653```
You can’t perform that action at this time.
0 commit comments