GuzzleHttpjson_encode

Wrapper for JSON encoding that throws when an error occurs.

Description

(string) GuzzleHttp\json_encode( (mixed) $value, (int) $options = 0, (int) $depth = 512 ); 

Returns (string)

Parameters (3)

0. $value (mixed)
The value being encoded
1. $options — Optional. (int)
JSON encode option bitmask
2. $depth — Optional. (int) => 512
Set the maximum depth. Must be greater than zero.

Usage

  1. if ( !function_exists( 'GuzzleHttp\json_encode' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'w3-total-cache/lib/Azure/GuzzleHttp/functions.php'; 
  3.  
  4. // The value being encoded 
  5. $value = null; 
  6.  
  7. // JSON encode option bitmask 
  8. $options = -1; 
  9.  
  10. // Set the maximum depth. Must be greater than zero. 
  11. $depth = 512; 
  12.  
  13. // NOTICE! Understand what this does before running. 
  14. $result = GuzzleHttp\json_encode($value, $options, $depth); 
  15.  

Defined (1)

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

/lib/Azure/GuzzleHttp/functions.php