Zend\Json\Decoder::decode
Decode a JSON source string
Decodes a JSON encoded string. The value returned will be one of the following: - integer - float - boolean - null - stdClass - array - array of one or more of the above types By default, decoded objects will be returned as associative arrays; to return a stdClass object instead, pass to the $objectDecodeType parameter.
Signature
public function decode(string
$source,
[int
$objectDecodeType = Json::TYPE_OBJECT] )
Parameters
$source
— string- String to be decoded
$objectDecodeType
— int- How objects should be decoded; should be
either or or
; defaults to TYPE_ARRAY
Returns
- mixed