0
I have an array in php and I need to group the values to be able to place them in a table>phtml
Segue jsonArray You’ll always have these five types of transport.
I couldn’t do much to leave here what’s already been done, the only thing I have is
public function relatorio($dtInicio, $dtFinal) {
$dbControleVeiculos = new \Db\Fisc\ControleVeiculos();
$original = iterator_to_array($dbControleVeiculos->getResumoControleVeiculos($dtInicio, $dtFinal));
$result = array();
foreach ($original as $data) {
$id = $data['nome'];
if (isset($result[$id])) {
$result[$id][] = $data;
} else {
$result[$id] = array($data);
}
}
return $result;
// return
}
My goal is to keep it that way.