I'm using this sample code to call my person Instagram feed. Everything works the second time, but on the initial call I get a Invalid argument supplied for foreach()
. Can't figure out why it only works part of the time...
The PHP code:
<?php
foreach ($response['data'] as $data) {
$link = $data['link'];
$id = $data['id'];
$caption = $data['caption']['text'];
$author = $data['caption']['from']['username'];
$thumbnail = $data['images']['low_resolution']['url'];
$username = $data['user']['username'];
$fullname = $data['user']['full_name'];
?>