How can I decode json in PHP 5.1?

前端 未结 8 924
孤街浪徒
孤街浪徒 2020-12-16 20:10

json_decode function is not part of PHP 5.1, so I cannot use it. Is there any other function for this version?

8条回答
  •  隐瞒了意图╮
    2020-12-16 20:50

    I ran into the same issue running PHP 5.1.6, but I couldn't upgrade or install extensions on my client's server. To make matters worse, the JSON.org site was down when I needed a solution but fortunately this file on Google Code worked perfectly! I would have preferred to actually define json_encode/json_decode, but calling fromJSON() worked just fine.

    http://code.google.com/p/simplejson-php/

提交回复
热议问题