I have a page where I receive arrays by the _POST method from a form and I need to create a row with each group of data:
$idfila = $_POST['idfila'];
$destino = $_POST['destino'];
$pedidohs = $_POST['pedidohs'];
$pedido_desarrollo = $_POST['pedido_desarrollo'];
$rendicionhs = $_POST['rendicionhs'];
if (isset($idfila))
{
foreach ($idfila as $clave=>$idfilarecibido)
{
echo '<tr>';
foreach ($destino as $clave=>$destinorecibido)
{
echo '<td>'.$destinorecibido.'</td>';
}
foreach ($pedidohs as $clave=>$pedidohsrecibido)
{
echo '<td>'.$pedidohsrecibido.'</td>';
}
foreach ($pedido_desarrollo as $clave=>$pedido_desarrollorecibido)
{
echo '<td>'.$pedido_desarrollorecibido.'</td>';
}
foreach ($rendicionhs as $clave=>$rendicionhsrecibido)
{
echo '<td>'.$rendicionhsrecibido.'</td>';
}
echo '</tr>';
}
}
I can not assemble a table with each group of data, row by row.
The arrays I receive are variable and the results similar to the following:
array (3) {[0] = > string (1) "1" [1] = > string (1) "2" [2] = > string (1) "3"} array (3) {[1] = > string (12) "Belgrano 361" [2] = > string (9) "Jump 244" [3] = > string (11) "Bulnes 1544"} array (3) {[1] = > string (5) "14:00" [2] = > string (5) "14:30" [3] = > string (5) "17:00"} array (3) {[1] = > string (5) "About" [2] = > string (4) "Payment" [3] = > string (8) "Collection"} array (3) {[1] = > string (5) "16:00" [2] = > string (5) "17:00" [3] = > string (5) "18:00"}
And I need to show it in the following way:
<table>
<tr>
<th>Id</th>
<th>Destino</th>
<th>Hora de Gestión</th>
<th>Desarrollo del trámite</th>
<th>Hora de Rendición</th>
</tr>
<tr>
<td>1</td>
<td>Belgrano 361</td>
<td>14:00</td>
<td>Sobre</td>
<td>16:00</td>
</tr>
<tr>
<td>2</td>
<td>Salta 244</td>
<td>14:30</td>
<td>Pago</td>
<td>17:00</td>
</tr>
<tr>
<td>3</td>
<td>Bulnes 1544</td>
<td>17:00</td>
<td>Cobranza</td>
<td>18:00</td>
</tr>
</table>
Any suggestions? Thank you very much!