GuzzleHttpPsr7copy_to_string

Copy the contents of a stream into a string until the given number of bytes have been read.

Description

(string) GuzzleHttp\Psr7\copy_to_string( (StreamInterface) Psr\Http\Message\StreamInterface $stream, (int) $maxLen = -1 ); 

Returns (string)

Parameters (2)

0. $stream (StreamInterface) => Psr\Http\Message\StreamInterface $stream
Stream to read
1. $maxlen (int)
Maximum number of bytes to read. Pass -1 to read the entire stream.

Usage

  1. if ( !function_exists( 'GuzzleHttp\Psr7\copy_to_string' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'w3-total-cache/lib/Azure/GuzzleHttp/Psr7/functions.php'; 
  3.  
  4. // Stream to read 
  5. $stream = Psr\Http\Message\StreamInterface $stream; 
  6.  
  7. // Maximum number of bytes to read. Pass -1 
  8. // to read the entire stream. 
  9. $maxlen = -1; 
  10.  
  11. // NOTICE! Understand what this does before running. 
  12. $result = GuzzleHttp\Psr7\copy_to_string($stream, $maxlen); 
  13.  

Defined (1)

The function is defined in the following location(s).

/lib/Azure/GuzzleHttp/Psr7/functions.php