title: How can I get only a part of a json file instead of the entire thing with php?
body: <p>I'm connecting to the trakt.tv api, I want to create a little app for myself that displays movies posters with ratings etc.</p>
  
  <p>This is what I'm currently using to retrieve their .json file containing all the info I need.</p>
  
  <pre><code>$json = file_get_contents('http://api.trakt.tv/movies/trending.json/2998fbac88fd207cc762b1cfad8e34e6');
  $movies = json_decode($json, true);
  
  $movies = array_slice($movies, 0, 20);
  
  foreach($movies as $movie) {
      echo $movie['images']['fanart'];
  }
  </code></pre>
  
  <p>Because the .json file is huge it is loading pretty slow. I only need a couple of attributes from the file, like title,rating and the poster link. Besides that I only need the first 20 or so. How can I make sure to load only a part of the .json file to load it faster?</p>
  
  <p>Besides that I'm not experienced with php in combination with .json so if my code is garbage and you have suggestions I would love to hear them.</p>