Class MOXMAN_Util_Json

InheritanceMOXMAN_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

Hide inherited methods

MethodDescriptionDefined 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

decode() public static method

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.

encode() public static method

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.