My code is giving an error. I know now it has to do with the php version. But to what should i change my code for it to work correctly?
$json = file_get_contents(
'https://api.instagram.com/v1/users/'. $user_id .'/media/recent/?client_id=' . $client_id . '&count=' . $count);
$decode = json_decode($json, true);
$output = '';
$func = function($post['tags']){
$i=0;
while(!empty($post['tags'])){
return $post['tags'][$i]." ";
$i++;
}
};
foreach ($decode['data'] as $post) {
$output .= $modx->getChunk($tpl,
array(
'link' => $post['link']
,'image' => $post['images']['standard_resolution']['url']
,'likes' => $post['likes']['count']
,'hashtags' => $func
)
);
}
return $output;
Thanks