-1
I have two array one that limits me and the other that comes with the database information.
$limite = array("06","07","08","09","10","11","12");
$mes = array("09","10","11","12");
it generates a table row. When compared I want you to print the value of $mes when you have it in the same limit index. And when you don’t find the value comes out zero. I even made but it prints the empty values at the end and not at the beginning as I want
<table>
<tr>
<td></td>
<td></td>
<td>09</td>
<td>10</td>
<td>11</td>
<td>12</td>
</tr>
here is the code I made but only prints at the end instead of the beginning
for($a=0;$a<count($semestre2);$a++){
$mes = array_search($mes[$a], $limite);
if($mes){
echo '<td>'.$dateRange[$a].'_p'].'</td>';
}else{
echo '<td></td>';
}
}
Will the data always return so ordered? For example: limit(06,07,08...) and ordered month tbm, type: (09,10,11)? At no time can this happen, ex:
array("06","09","10","11","12")
, see which way from the bank, (06,09...)– Fabiano Monteiro
Who is the $semestre2? Because you count it to assemble the cells of the table.
– Fabiano Monteiro