title: PHP : understanding each function with array
body: <p>I am  doing some basic PHP stuff from a book and in arrays section I got this example:</p>
  
  <pre><code>$array=  array('Books '=&gt;3 , 'Pens' =&gt; 4);
  while ($element= each($array)){
      echo $element[0].' - '. $element[1].'&lt;br/&gt;';
  }
  </code></pre>
  
  <p>So this is the output: </p>
  
  <pre><code>Books - 3
  Pens - 4
  </code></pre>
  
  <p>My question is that when we parse this array in loop does it return every element as array? I mean   <strong>$element[0]</strong>  is index 0 and <strong>$element[1]</strong> is index 1 for Books and then for Pens or its key pair value?</p>