Class MOXMAN_Util_Json
Inheritance | MOXMAN_Util_Json |
---|
Json encoder/decoder utility class. This will use the internal json functions in PHP if they are available or fall back to custom PHP implementations.
Public Methods
Method | Description | Defined By |
---|---|---|
decode() | Decodes the specified JSON string into an native PHP type. | MOXMAN_Util_Json |
encode() | Encodes the specified PHP type into a JSON string. | MOXMAN_Util_Json |
Method Details
Decodes the specified JSON string into an native PHP type.
public static Mixed decode ( $str ) | ||
$str | string | JSON string to parse. |
return | Mixed | Native PHP type based on JSON data. |
---|
Encodes the specified PHP type into a JSON string.
public static \A encode ( $obj, $pretty = false ) | ||
$obj | Object | PHP object to encode as JSON. |
$pretty | Boolean | Pretty output. |
return | \A | JSON string out of the specified object. |
---|