title: php logic loop step by 5
body: <p>I am reading an excell file with php. No problem with that but I am stuck on a little logical part. I want to make an array that containts multiple other arrays with data. </p>
  
  <p>The data is provided in my excell file I know from what column should start reading but not when to stop because this is dynamic. </p>
  
  <p>My question is how can a make a loop that reads my columns and makes on every 5th column a new array.</p>
  
  <p>so what I want is something like this: </p>
  
  <pre><code>(My data for the excell file is proved in $line[] each column has its number.)
          array(
          'length' =&gt; $line[15],
          'width' =&gt; $line[16]
          'price_per' =&gt; $line[17],
          'price' =&gt; $line[18],
          'stock' =&gt; $line[19]
      ),
      array(
          'length' =&gt; $line[20],
          'width' =&gt; $line[21]
          'price_per' =&gt; $line[22],
          'price' =&gt; $line[23],
          'stock' =&gt; $line[24]
      ),
      array(
          'length' =&gt; $line[25],
          'width' =&gt; $line[26]
          'price_per' =&gt; $line[27],
          'price' =&gt; $line[28],
          'stock' =&gt; $line[29]
      ), ....
  </code></pre>
  
  <p>So how can I make this dynamic (for loop ?) so that I have 1 big indexed Array , with multiple asscociated arrays? Note: my for loop should always star from line[15]! </p>