title: PHP - Array and loops for
body: <p>I need help, I am at a loss to understand what about array and loops "for". I have to display the column on the right cell.</p>
  
  <p>The answer of my query. note, I have 13 array like this:</p>
  
  <pre><code>print_r ($toto) = 
  
  Array ( [0] =&gt; 
  
     Array ( [id_depot] =&gt; 21758777 
             [code_stp] =&gt; CHI 
             [date_depot_const] =&gt; 20/11/18 
             [date_depot_decla] =&gt; 
             [num_bip] =&gt; 0100514871
             [num_depot] =&gt; AB421743 
             [typ_depot] =&gt; 51004 
             [typ_declaration] =&gt; ) 
  </code></pre>
  
  <p>My html:</p>
  
  <pre><code> &lt;table&gt;
   &lt;tr&gt;
   &lt;th&gt;ID_DEPOT&lt;/th&gt;
   &lt;th&gt;CODE_STP&lt;/th&gt; 
   &lt;th&gt;DATE_DEPOT_CONST&lt;/th&gt;
   &lt;th&gt;DATE_DEPOT_DECLA&lt;/th&gt;
   &lt;th&gt;NUM_BIP&lt;/th&gt;
   &lt;th&gt;NUM_DEPOT&lt;/th&gt;
   &lt;th&gt;TYP_DEPOT&lt;/th&gt;
   &lt;th&gt;TYP_DECLARATION&lt;/th&gt;
   &lt;/tr&gt;
  &lt;?php 
   $i = 0;
   for ($i=0 ;$i &lt;= count($this-&gt;toto);$i++){
   echo '&lt;tr&gt;';
   echo '&lt;td&gt;'.$this-&gt;toto['id_depot'].'&lt;/td&gt;';
   echo '&lt;td&gt;'.$this-&gt;toto['code_stp'].'&lt;/td&gt;';
   echo '&lt;td&gt;'.$this-&gt;toto['date_depot_const'].'&lt;/td&gt;';
   echo '&lt;td&gt;Jill&lt;/td&gt;';
   echo '&lt;td&gt;Smith&lt;/td&gt;';
   echo '&lt;td&gt;50&lt;/td&gt;';
   echo '&lt;td&gt;Jill&lt;/td&gt;';
   echo '&lt;td&gt;Smith&lt;/td&gt;';
   echo '&lt;/tr&gt;';
   }   
  ?&gt;
  </code></pre>
  
  <p>Of course i have to fill all the column but currently I fill only 3 for the example</p>
  
  <p>The answer :</p>
  
  <p><a href="https://i.stack.imgur.com/DJUNf.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DJUNf.png" alt="enter image description here"></a></p>
  
  <p>My first three column are empty and I don't know why :( it should display my array... Do you have an idea?</p>