As of PHP 5.2.0, the JSON extension is bundled and compiled into PHP by default. 建议楼主更新php吧……>=5.3.4
/** * (PHP 5 >= 5.2.0, PECL json >= 1.2.0)<br/> * Returns the JSON representation of a value * @link http://php.net/manual/en/function.json-encode.php * @param mixed $value <p> * The value being encoded. Can be any type except * a resource. * </p> * <p> * This function only works with UTF-8 encoded data. * </p> * @param int $options [optional] <p> * Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT. * </p> * @return string a JSON encoded string on success. */从php 标准库来看,是php >=5.2.0 PECL json >= 1.2.0 时开始支持!
As of PHP 5.2.0, the JSON extension is bundled and compiled into PHP by default.
建议楼主更新php吧……>=5.3.4
* (PHP 5 >= 5.2.0, PECL json >= 1.2.0)<br/>
* Returns the JSON representation of a value
* @link http://php.net/manual/en/function.json-encode.php
* @param mixed $value <p>
* The value being encoded. Can be any type except
* a resource.
* </p>
* <p>
* This function only works with UTF-8 encoded data.
* </p>
* @param int $options [optional] <p>
* Bitmask consisting of JSON_HEX_QUOT, JSON_HEX_TAG, JSON_HEX_AMP, JSON_HEX_APOS, JSON_NUMERIC_CHECK, JSON_PRETTY_PRINT, JSON_UNESCAPED_SLASHES, JSON_FORCE_OBJECT.
* </p>
* @return string a JSON encoded string on success.
*/从php 标准库来看,是php >=5.2.0 PECL json >= 1.2.0 时开始支持!