I just thought I should quickly post this note simply because I know a few people might have problems with parsing it with the above functions.
I would like first to say that json_encode and json_decode are PHP 5.2.0+ methods of parsing and dealing with Javascript Simple Object Notation. basically looks a bit like this {“key”:”value”}. The idea is to be able to do useful things with objects like these and stepping through the key and value pairs while doing something with them.
The problem however is you sometimes get JSON sent as a string through an HTTP method like $_POST and the quotes in there are automatically (well in my case). escaped with backslashes like this {\”jsonkey\”:\”jsonvalue\”}. Before you actually call json_decode on your json data use the built in stripslashes function first. so your code should look like this in one line
$json_array = json_decode(stripslashes($jsonObject));
hope this helps someone.