json_decode function is not part of PHP 5.1, so I cannot use it. Is there any other function for this version?
You're seeing this error because you have a php version earlier than 5.2.0. These functions are included by default in php 5.2.0 and later.
PHP Fatal error: Call to undefined function json_encode()
You can install the PECL extension by running:
pecl install json
It will compile, then add this to your php.ini
file: (mine is in /etc/php5/apache2
)
extension=json.so
Then restart apache.