I\'m new to PHP and JSON, so hoping someone can help me.
I have a PHP which a 3rd party performs a POST against, delivering JSON data. An example of the data sent wo
First, I would suggest passing true
as the second argument to json_decode
. This results in an associative array rather than an object, which makes it a little easier to work with.
Then, you can do this:
$fee = $event_json['data']['object']['fee'];
You can chain these square brackets as many times as needed to delve deeper into the array.