I need to export data from an array inside an html table, the function is working but I do not know how to export with while inside a table, I made an analogy with the code below.
function imprimir_Tbl($Id, $Nome){
$array = array();
for($i=0; $i<= $Id; $i++){
$array["id"][] = $i + 1;
$array["nome"][] = $Nome.' '.($i + 1);
}
return $array;}
Using var_dump the data is printed correctly, the expected result is as follows
<table border="0">
<thead>
<tr>
<th>Id</th>
<th>Nome</th>
</tr>
</thead>
<tbody>
<tr>
<td>1</td>
<td>Nome 1</td>
</tr>
<tr>
<td>2</td>
<td>Nome 2</td>
</tr>
<tr>
<td>3</td>
<td>Nome 3</td>
</tr>
<tr>
<td>4</td>
<td>Nome 4</td>
</tr>
</tbody>