title: How to iterate only the first 3 elements of an array and access the keys/values?
body: <p>I was trying to assign each seller their monthly points, based on the amount of products they sell. The numbers, however, are just an example.
  This is my code so far:</p>
  
  <pre><code>$sellers = array(
      'Edvin'   =&gt; 10, 
      'Julio'   =&gt;  9, 
      'Rene'    =&gt;  8, 
      'Jorge'   =&gt;  7, 
      'Marvin'  =&gt;  6,
      'Brayan'  =&gt;  5, 
      'Sergio'  =&gt;  4,   
      'Delfido' =&gt;  3, 
      'Jhon'    =&gt;  2
  );
  
  $a = 1;
  foreach ($sellers as $seller =&gt; $points) {
      while ($a &lt; 4) {
          echo "The seller top " . $a . " is " . $sellers[$a - 1] . ' with ' . $points[$a] . '&lt;br&gt;';
          $a++;
      }
  }
  </code></pre>
  
  <p>I am trying to output this:</p>
  
  <pre><code>The seller top 1 is Edvin with 10&lt;br&gt;
  The seller top 2 is Julio with 9&lt;br&gt;
  The seller top 3 is Rene with 8&lt;br&gt;
  </code></pre>