PHP Working With JSON
In this code snippet, we’ll learn how to work with JSON in PHP. You can use json_encode() to serialize and json_decode() to deserialize JSON. json_decode() also takes a second parameter(true/false) where you can specify if you want the JSON to deserialized to an associative array or to an object. In this post, you can see a practical example of JSON serialization/deserialization.