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?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
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.