← All docs

stream_get_contents()

Reads remainder of a stream into a string.

stream_get_contents()

function stream_get_contents(resource $stream, int $length = null, int $offset = -1): mixed

Reads remainder of a stream into a string.

Parameters:

  • $stream (resource)
  • $length (int), default null, optional
  • $offset (int), default -1, optional

Returns: mixed

Availability

No examples yet — check examples/ and showcases/ for usage patterns.

Internals

For how stream_get_contents is implemented in the compiler, see the internals page.