title: PHP For each displaying all the results 10 at a time
body: <p>Currently I am working with <a href="https://developers.google.com/youtube/" rel="nofollow noreferrer">YouTube's API</a> for returning the related videos of a video, it returns the 15 results with the following.</p>
  
  <pre><code>get https://www.googleapis.com/youtube/v3/search?part=snippet&amp;relatedToVideoId='.$id.'&amp;type=video&amp;maxResults=16&amp;key='.$key.'
  </code></pre>
  
  <p>But how can I return this data in a <code>foreach</code> instead of just printing it, with the following.</p>
  
  <pre><code>print '&lt;pre&gt;';
      print_r($related);
  print '&lt;/pre&gt;';
  </code></pre>
  
  <p>I'm not a developer but I'm trying to learn.. I would like for it to display 10 results, and then an option to show more which will show another 10.</p>
  
  <p>The results I'm getting from the above code goes as following.
  <a href="http://pastebin.com/5ikPeFQm" rel="nofollow noreferrer">http://pastebin.com/5ikPeFQm</a></p>