Reputation: 159
JSON encode for php 5.2 seems to be buggy. I need a way to upgrade it to php 5.3+ without changing my PHP version, is this possible? If so how?
Thanks
Found the problem - it was an encoding problem in the end with my string. Use:
iconv('Windows-1252', 'UTF-8', $string);
Jsonencode fails if your string is not properly encoded.
Upvotes: 0
Views: 183
Reputation: 3729
I don't know what bugs your getting, but someong at php.net wrote a function for version before 5.2, maybe that will work for you, just give it a new name like "myjson"
See: craig at craigfrancis dot co dot uk's listing.
Upvotes: 1