Hi Nick,

Nice article. I ran into this problem the other day but for a slightly different reason. A lot of web hosts run RHEL 5 or CentOS 5, which include the fairly out-of-date PHP 5.1.6. The function json_decode() was added to PHP in 5.2.0, so if you need to use it in a web app that's hosted on one of these platforms you will run into problems.

Luckily there is still a workaround, you can just add in an external file that defines the function if it's missing. See http://web.archive.org/web/20090429084654/http://forums.mawhorter.net/v…, I tried it and it works a treat on PHP 5.1.6 while still maintaining compatibility with PHP 5.2.0+.

Wed, 13/10/2010 - 12:53 Permalink

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <p> <br> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Web page addresses and email addresses turn into links automatically.
  • Lines and paragraphs break automatically.
CAPTCHA