title: Build an array dynamically in php
body: <p>I need that this array become dynamic: (initial output)</p>
  
  <pre><code>$data[0] = array('var0');
  </code></pre>
  
  <p>I have a for cycle that returns (after a few conditions) something as a VAR:</p>
  
  <pre><code>for($i = 0; $i &lt; N; $i++) 
      {
      (...) END AS var1;
      (...) END AS var2;
      (...) END AS var3;
      (...) END AS varN;
      (...) END AS (...)
      }
  </code></pre>
  
  <p>Expected output after the first cycle:</p>
  
  <pre><code> $data[0] = array('var0','var1');
  </code></pre>
  
  <p>Expected output after the second cycle:</p>
  
  <pre><code> $data[0] = array('var0','var1','var2');
  </code></pre>
  
  <p>And go on (expected final output):</p>
  
  <pre><code> $data[0] = array('var0','var1','var2','var3','varN');
  </code></pre>
  
  <p>How could it be done?</p>