Skip to content

Commit f93fca7

Browse files
author
Wazabii
committed
Guide
1 parent 890d701 commit f93fca7

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,10 +82,16 @@ $stream = new Http\Stream(
8282

8383
#### Write to stream
8484
```php
85-
$stream = new Http\Stream(Http\Stream:TEMP);
86-
$stream->write("Hello world");
87-
$stream->seek(0);
88-
echo $stream->read(); // Hello world
85+
$stream = new Http\Stream(Http\Stream::TEMP);
86+
if ($stream->isSeekable()) {
87+
$stream->write("Hello world");
88+
//echo $stream; // will print Hello world
89+
// Or
90+
$stream->rewind();
91+
echo $stream->getContents(); // Hello world
92+
// Or Same as above
93+
//echo $stream->read($stream->getSize());
94+
}
8995
```
9096

9197
#### Get file content with stream

0 commit comments

Comments
 (0)