The following array has multiple data arrays. Some of the data arrays have field message, while others don't have.
I want to get the message and the created_time field from the arrays which have those fields.
I can get the data without the loop, for example:
$msg = $json['posts']['data'][0]['message'];
but how can I use the loop and get the message fields from all arrays which have that field.
Array
(
[id] => 1234
[posts] => Array
(
[data] => Array
(
[0] => Array
(
[id] => 123_456
[from] => Array
(
[name] => User Name
[id] => 123
)
[message] => This is the message i want to get.
[privacy] => Array
(
[value] =>
)
[type] => status
[status_type] => mobile_status_update
[created_time] => 2013-01-13T11:09:55+0000
[updated_time] => 2013-01-13T11:09:55+0000
[comments] => Array
(
[count] => 0
)