Skip to content

Stream: getContents Example

Terry L edited this page Jun 20, 2020 · 2 revisions

Shieldon\Psr7\Stream

getContents()

Returns the remaining contents in a string

  • return string

Example:

$stream = new Stream(fopen('php://temp', 'r+'));
$stream->write('Glory to Hong Kong');

echo $stream->getContents();

// Outputs: Glory to Hong Kong
Clone this wiki locally