SO I’ve been searching for a while now but I haven’t found anything useful. Im interested in decoding a json code like this:
[
{"server":"1","available":true},
{"server":"2","available":false},
{"server":"3","available":true},
{"server":"4","available":true}
]
I want to decode that using json_decode in php. How can I do that? =)
With the php native function
json_decodeyou will get an structure that matches the json structure.Use the function like this:
With this code you will have in $myobject this structure: