I have the following code:
$images = array();
foreach ($media->data as $data) {
$images['src'] = $data->images->thumbnail->url;
$images['user'] = $data->user->username;
$images['time'] = $data->created_time;
}
echo json_encode(array(
'next_id' => $pagination->next_page,
'images' => array('src' => $images['src'], 'user' => $images['user'], 'time' => $images['time'])
));
I want it to display all the fields but it only outputs one. How Ccn I make it display all the fields on json output?
Thank you.
$media->data?