Quantcast
Channel: Limit Instagram php feed - Stack Overflow
Viewing all articles
Browse latest Browse all 3

Limit Instagram php feed

0
0

I'm looking for some helping with using a php instagram feed.

I found this link through my research and it works perfectly but I don't know how to limit the results from instagram's default of 20.

I'd really just like to show 6 images at a time.

I'm not great with php so please forgive my ignorance.

Please see the code below

<?phpfunction fetchData($url) {    $ch = curl_init();    curl_setopt($ch, CURLOPT_URL, $url);    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);    curl_setopt($ch, CURLOPT_TIMEOUT, 20);    $result = curl_exec($ch);    curl_close($ch);     return $result;}$result = fetchData("https://api.instagram.com/v1/users/ID-GOES-HERE/media/recent/?access_token=TOKEN-GOES-HERE");$result = json_decode($result);foreach ($result->data as $post) {    // Do something with this data.}?>

Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images