## Zend_Json

Description

Class for encoding to and decoding from JSON.

- license: New BSD License
- copyright: Copyright (c) 2005-2007 Zend Technologies USA Inc. (http://www.zend.com)

Located in /Zend/Json.php (line 30)

Class Constant Summary
TYPE_ARRAY = 1
TYPE_OBJECT = 0
Method Summary
static mixed decode (string $encodedValue, [int $objectDecodeType = Zend_Json::TYPE_ARRAY])
static string encode (mixed $valueToEncode, [boolean $cycleCheck = false])
Methods
static decode (line 51)

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

Uses ext/json's json_decode if available.

- access: public

static mixed decode (string $encodedValue, [int $objectDecodeType = Zend_Json::TYPE_ARRAY])

- string $encodedValue: Encoded in JSON format
- int $objectDecodeType: Optional; flag indicating how to decode objects. See ZJsonDecoder::decode() for details.

static encode (line 76)

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

- return: JSON encoded object
- access: public

static string encode (mixed $valueToEncode, [boolean $cycleCheck = false])

- mixed $valueToEncode
- boolean $cycleCheck: Optional; whether or not to check for object recursion; off by default

Class Constants
TYPE_ARRAY = 1 (line 37)

How objects should be encoded -- arrays or as StdClass. TYPE_ARRAY is 1 so that it is a boolean true value, allowing it to be used with ext/json's functions.

TYPE_OBJECT = 0 (line 38)

Documentation generated on Wed, 21 Feb 2007 11:52:43 -0800 by phpDocumentor 1.3.1