title: how to get pictures url from instagram API Json result
body: <p>I´m currently trying to get all the URLs for my pictures from my instagram feed and print them out in a simple HTML gallery. </p>
  
  <p>I have managed with "some help" to authenticate and get an <code>accesstoken</code> which allows me to get a JSON result containing all my pictures, but I´m totally new to how to fetch all the pictures with the help of JSON. </p>
  
  <p>The code I've got so far looks like this:</p>
  
  <pre><code>&lt;?php
  session_start();
  //require_once 'src/config.php';
  
  $n_client_id = '87fdd319f8244a728a86f3692527fb15';
  $n_client_secret = '040d431d4e0247a292612229446b5240';
  $n_redurect_uri = 'http://ideweb2.hh.se/~lukpal12/Startsida.php';
  
  //require_once 'src/Instagram.php';
  date_default_timezone_set('UTC');
  
  $url = "https://api.instagram.com/oauth/access_token";
  $access_token_parameters = array(
      'client_id'     =&gt;     $n_client_id,
      'client_secret'     =&gt;     $n_client_secret,
      'grant_type'        =&gt;     'authorization_code',
      'redirect_uri'      =&gt;     $n_redurect_uri,
      'code'          =&gt;     $_GET["code"]
  );
  $curl = curl_init($url);
  curl_setopt($curl,CURLOPT_POST,true);
  curl_setopt($curl,CURLOPT_POSTFIELDS,$access_token_parameters);
  curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
  curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
  $result = curl_exec($curl);
  
  $authObj = json_decode($result);
  
  print_r($result);
  
  $instagram = &lt;&lt;&lt;END
  &lt;a href="https://api.instagram.com/v1/users/2912979/media/recent/?access_token={$authObj-&gt;access_token}"&gt;Get pictars!&lt;/a&gt;
  END;
  
  echo $instagram;
  
  echo $authObj-&gt;access_token;
  
  ?&gt;
  </code></pre>
  
  <p>Since I'm completely new to JSON and how to work with it, I have no idea how the code should be written to do what I'm asking. </p>
  
  <p>After some searching around and after a video or two explaining JSON I managed to get this code to do the <code>Json_decode</code>:</p>
  
  <pre><code>$json = file_get_contents("https://api.instagram.com/v1/users/2912979/media/recent/?access_token=2912979.87fdd31.0949d22f4a714349ae84643c5af165ef");
  $data = json_decode($json);
  echo $data-&gt;standard_resolution[0]-&gt;url; 
  </code></pre>
  
  <p>But that does not work at all. I've got the link to the JSON containing all the data here:</p>
  
  <p><a href="https://api.instagram.com/v1/users/2912979/media/recent/?access_token=2912979.87fdd31.0949d22f4a714349ae84643c5af165ef" rel="nofollow noreferrer">https://api.instagram.com/v1/users/2912979/media/recent/?access_token=2912979.87fdd31.0949d22f4a714349ae84643c5af165ef</a> </p>
  
  <p>If someone would be kind enough to help me out.</p>