title: PHP Pushing at the end of multidimensional array
body: <p>So I am trying to do the following.
  I have an array that contains 12 numbers(months).</p>
  
  <pre><code>$array = array();
  $array[1] = array();
  </code></pre>
  
  <p>and so on.</p>
  
  <p>Now, I am trying to push numbers into second place like
  $array[5][day should be pushed here] trying like so</p>
  
  <pre><code>$counter = 0;
  while($counter &lt;= $elements)
  {
  if($something == $something)
  {
      $startfrom = 14; //example
      $month = 5; //example
      while($startfrom &lt;= 20)
      {
      array_push($array[$month], $startfrom );
      $startfrom ++;
      }
  }
  </code></pre>
  
  <p>But its always returning an error. Like this
   Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 36 bytes) in F:\xampp\htdocs\NewPassword\Testt\process_info.php on line 27</p>
  
  <p>What I am trying to achieve is that each day goes to its responding month.</p>
  
  <p>Thanks.</p>
  
  <p>Edit:
  Nwm, fixed I did biggest rookie mistake I could. I wasn't incrementing counter out of if statement... Thank you APerson.</p>