Solar_Json::decode()

public mixed Solar_Json::decode ( string $encodedValue , bool $asArray = false )

Decodes the $encodedValue string which is encoded in the JSON format.

Parameters

  • (string) $encodedValue: String encoded in JSON format

  • (bool) $asArray: Optional argument to decode as an array. Default false.

Returns

  • (mixed) decoded value

Description

Decodes the $encodedValue string which is encoded in the JSON format.

For compatibility with the native json_decode() function, this static method accepts the $encodedValue string and an optional boolean value $asArray which indicates whether or not the decoded value should be returned as an array. The default is false, meaning the default return from this method is an object.

For compliance with the » JSON specification, no attempt is made to decode strings that are obviously not an encoded arrays or objects.



Local