PHP code example of elxdigital / instagram

1. Go to this page and download the library: Download elxdigital/instagram library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

elxdigital / instagram example snippets




e('INSTAGRAM_TOKEN', '<YOUR_TOKEN help="manual.md"/>');

$instagram = new ElxDigital\Instagram\Services\Media(INSTAGRAM_TOKEN);
$medias = $instagram->getMedia();

if (!empty($medias)) {
    foreach ($medias as $media) {
        if ($media->media_type == 'IMAGE') {
            echo "<img src='{$media->media_url}' alt='{$media->caption}' width='200'>";
        }
    }
}