yoppipipi yoppipipi - 7 months ago 44
PHP Question

How can I parse JSON in Php?

How can I get ioemks and wegraes?


I want to get something like this:


Thank you!


Decoding a JSON String in php uses the json_decode functon, normally when decoing json with json_decode($json); it would return an object. But if you want to receive an array you would do: json_decode($json, true);.

json_decode(); is a strict function and will return null or nothing if the syntaxes are incorrect!

json_decode('{"Something":"some_other_thing"}'); // Will return an object
json_decode('{"Something":"some_other_thing"}', true); // Will return an array
json_decode('{"something":"some_other_thing"'); // Will return NULL or NOTHING

As mentioned in user3019115's anwer: Take a look : JSON_DECODE