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.
The answer of my query. note, I have 13 array like this:
print_r ($toto) =
Array ( [0] =>
Array ( [id_depot] => 21758777
[code_stp] => CHI
[date_depot_const] => 20/11/18
[date_depot_decla] =>
[num_bip] => 0100514871
[num_depot] => AB421743
[typ_depot] => 51004
[typ_declaration] => )
My html:
<table>
<tr>
<th>ID_DEPOT</th>
<th>CODE_STP</th>
<th>DATE_DEPOT_CONST</th>
<th>DATE_DEPOT_DECLA</th>
<th>NUM_BIP</th>
<th>NUM_DEPOT</th>
<th>TYP_DEPOT</th>
<th>TYP_DECLARATION</th>
</tr>
<?php
$i = 0;
for ($i=0 ;$i <= count($this->toto);$i++){
echo '<tr>';
echo '<td>'.$this->toto['id_depot'].'</td>';
echo '<td>'.$this->toto['code_stp'].'</td>';
echo '<td>'.$this->toto['date_depot_const'].'</td>';
echo '<td>Jill</td>';
echo '<td>Smith</td>';
echo '<td>50</td>';
echo '<td>Jill</td>';
echo '<td>Smith</td>';
echo '</tr>';
}
?>
Of course i have to fill all the column but currently I fill only 3 for the example
The answer :
My first three column are empty and I don't know why :( it should display my array... Do you have an idea?

forinstead offoreach?