I can't find anything in the PHP documentation, so maybe this is not possible without wrapping json_encode in a proprietary function.
But I was wondering, can I set the default parameters for json_encode function in php.ini or somewhere else?
The goal is to always have JSON_HEX_APOS and JSON_NUMERIC_CHECK, i.e.:
json_encode($object) will be equal
json_encode($object, JSON_HEX_APOS | JSON_NUMERIC_CHECK)
source
share