Zend\Json\Json::encode
Encode the mixed $valueToEncode into the JSON format
Encodes using ext/json's json_encode() if available. NOTE: Object should not contain cycles; the JSON format does not allow object reference. NOTE: Only public variables will be encoded NOTE: Encoding native javascript expressions are possible using Zend\Json\Expr. You can enable this by setting $options['enableJsonExprFinder'] = true
Signature
public function encode(mixed
$valueToEncode,
[bool
$cycleCheck = false,
array
$options] )
Parameters
$valueToEncode
— mixed$cycleCheck
— object- Optional; whether or not to check for object recursion; off by default
$options
— array- Additional options used during encoding
Returns
- string
- JSON encoded object