Cjson::encode()

Would it be possible to add the ability to pass json constants to CJSON::encode(). Currently we are running into an issue which is forcing us to use json_encode instead of CJSON::encode() because we cannot pass options (json constants) to CJSON::encode(). Would be be possible to add an extra param to cover this?

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, JSON_UNESCAPED_UNICODE. The behaviour of these constants is described on the JSON constants page.

Thanks in advance!

I don’t think there’s any reason not to use PHP’s json_encode() if you can guarantee that it’s available in your target environment. I believe the CJSON helper class is there to add support for earlier versions of PHP.