title: array_slice function with a foreach loop
body: <p>I have this array:</p>
  
  <pre><code>foreach ($r['result']['mounts']['collected'] as $item) echo '
  
                          &lt;li class="span3 clearfix" data-tag=', $item['qualityId'], '&gt;
                                  &lt;a
                                          href="//de.wowhead.com/item=', $item['itemId'], '"
                                          class="', $item['qualityId'], '"
                                  &gt;
                                          &lt;img
                                                  src="http://wow.zamimg.com/images/wow/icons/large/', $item['icon'], '.jpg"
                                                  alt="', htmlspecialchars($item['name']), '"
                                          &gt;
                          &lt;/li&gt;';
  
  echo '
  </code></pre>
  
  <p>The array is large and has over 500 (numeric) keys. I just want that the first 50 keys gets loaded. 
  Is it possible with the array_slice() function? But here is the problem I don´t know to handle it with a foreach loop. </p>