pagination;
$pagearray=json_decode(json_encode($page),true);
$pagecount=count($pagearray);

foreach( $data->data as $user_data )
{
$posts[$i++]=$user_data->link.” — ”.$user_data->images->standard_resolution->url;
}

if($pagecount>0)
return getPost($page->next_url,$i);
else
return $posts;
}
// $posts=getPost(”https://api.instagram.com/v1/users/self/media/liked?access_token=286702134.5903596.18e9c32779e140a8a7974a6a8066eed5”,0);
$posts=getPost(”https://api.instagram.com/v1/users/self/media/recent/?access_token=286702134.5903596.18e9c32779e140a8a7974a6a8066eed5″,0);

//print_r($posts);

foreach($posts as $value)
{
$str = explode(” — ”,$value);
$link = $str[0];
$img = $str[1];
echo(’’);
}

?>