title: PHP stop foreach()
body: <p>There is a variable <code>$posts</code>, which gives an array with many values.</p>
  
  <p><code>foreach()</code> is used for output:</p>
  
  <pre><code>foreach($posts as $post) {
      ...
  }
  </code></pre>
  
  <p>How to show only five first values from <code>$posts</code>?</p>
  
  <p>Like, if we have 100 values, it should give just five.</p>
  
  <p>Thanks.</p>