title: limiting number of times a loop runs in php
body: <p>I have a foreach loop that i need to limit to the first 10 items then break out of it.</p>
  
  <p>How would i do that here?</p>
  
  <pre><code>foreach ($butters-&gt;users-&gt;user as $user) {
      $id = $user-&gt;id;
      $name = $user-&gt;screen_name;
      $profimg = $user-&gt;profile_image_url;
      echo "things";    
  } 
  </code></pre>
  
  <p>Would appreciate a detailed explanation as well.</p>