I am working on a php script where I have a json api array that looks something like this --
[body] => stdClass Object
(
[api] => stdClass Object
(
[status] => 200
[message] => GET stat....
[results] => 379
[filters] => Array
(
[0] => gameId
[1] => playerId
)
[statistics] => Array
(
[0] => stdClass Object
(
[gameId] => 17
[totReb] => 7
[assists] => 5
[pFouls] => 4
[steals] => 3
[turnovers] => 2
[blocks] => 0
[plusMinus] => 9
[playerId] => 265
)
[1] => stdClass Object
(
[gameId] => 24
[teamId] => 7
[totReb] =>
[assists] =>
[pFouls] =>
[steals] =>
[turnovers] =>
[blocks] =>
[plusMinus] =>
[playerId] => 265
)
And I am trying to get the values for each object to then output the total, so for each [?] => stdClass Object it will get the specified key and total the value.
How can I add all the values from one key?
[steals] => 3