Class Zend_Json

Description

Class for encoding to and decoding from JSON.

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

Located in /Json.php (line 30)


	
			
Class Constant Summary
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 Sun, 27 May 2007 23:25:14 -0700 by phpDocumentor 1.3.2