title: Dynamically populate php array using foreach loop
body: <p>How can I implement the code:</p>
  
  <pre><code>$numberList3 = array();
  for($i = 0; $i &lt; 10; $i++)
  {
   $numberList3[$i] = $i;
  }
  print_r($numberList3);
  </code></pre>
  
  <p>Using a foreach loop as the no. of times the loop is going to execute is decided by the user at run time.
  Any suggestion.?</p>