public static function toJSON($objValue)
    {
        assert('is_array($objValue) || is_object($objValue)');    // json spec says only arrays or objects can be encoded
        $objValue = self::makeJsonEncodable($objValue);
        $strRet = json_encode($objValue);
        if ($strRet === false) {
            throw new Caller('Json Encoding Error: ' . json_last_error_msg());
        }
        return $strRet;
    }
public static function toJSON($objValue)
    {
        assert('is_array($objValue) || is_object($objValue)');    // json spec says only arrays or objects can be encoded
        $objValue = self::makeJsonEncodable($objValue);
        $strRet = json_encode($objValue);
        if ($strRet === false) {
            throw new Caller('Json Encoding Error: ' . json_last_error_msg());
        }
        return $strRet;
    }
public static function toJSON ( $ objValue ) { assert ( 'is_array($objValue) || is_object($objValue)' ) ; // json spec says only arrays or objects can be encoded $ objValue = self :: makeJsonEncodable ( $ objValue ) ; $ strRet = json_encode ( $ objValue ) ; if ( $ strRet === false ) { throw new Caller ( 'Json Encoding Error: ' . json_last_error_msg ( ) ) ; } return $ strRet ; }
Our specialized json encoder. Strings will be converted to UTF-8. Arrays will be recursively searched and
both keys and values made UTF-8. Objects will be converted with json_encode, and so objects that need a special
encoding should implement the jsonSerializable interface. See below
@param $objValue
@return string
@throws Caller
Our specialized json encoder . Strings will be converted to UTF - 8 . Arrays will be recursively searched and both keys and values made UTF - 8 . Objects will be converted with json_encode and so objects that need a special encoding should implement the jsonSerializable interface . See below