I'm stuck using an Apache server with an older php version. it doesn't have the function json_encode. does anybody know of a php script that can take care of this?
If it is absolutely not possible to upgrade your PHP, here are a few work arounds:
Upgrade.php - With 'upgrade.php' on-hand, you can use many features from newer PHP versions (up to 5.3/5.4 currently) without losing compatibility to older interpreters and outdated webserver setups. It takes care of emulating any functions (with their original names) that are missing at runtime. You just include() it into your application. Then you're freed from micromanaging backwards compliance and wasting time with workarounds. Simply use the more featureful PHP functions.
JSON-PHP - JSON-PHP is a PHP implementation of JSON, freely-available for download and use from pear.php.net.
Json Wrapper - jsonwrapper implements the json_encode function if it is missing, and leaves it alone if it is already present. So it is nicely future-compatible.
Something like that: http://www.php.net/manual/en/function.json-encode.php#74878 ??