title: How to append to an array inside another array in PHP
body: <p>I have an array that contains 4 elements (sub-arrays).</p>
  
  <pre><code>$orders = array( array(), array(), array(), array() );
  </code></pre>
  
  <p>Now, I want to tell each sub-array to append items to itself, so I iterate through them like so:</p>
  
  <pre><code>for($i=0; $i&lt;4 ; $i++ ) {
    $orders[$i][] = rand();     // this does not work, unexpected '['
  }
  </code></pre>
  
  <p>What is a better way for accomplishing this?</p>