Hello, I managed to solve using two foreach, see if it helps you:
$dados = [
'id' => [1,2,3,4],
'ocorrencia' => [10,13,17,18],
'justificativa' => ['1232132131','232323232','435454354','565656565']
];
foreach($dados as $chave => $d ){
//$chave = id, ocorrencia, justificativa
foreach($d as $indice => $valor){
//$indice = 0,1,2,3
//$valor = 10,13,17,18
/* $novoArray[0][id] = 1;
$novoArray[1][id] = 2;
$novoArray[2][id] = 3;
$novoArray[3][id] = 4;
$novoArray[0][ocorrencia] = 10;
$novoArray[1][ocorrencia] = 13;
$novoArray[2][ocorrencia] = 17; ... E por ai vai */
$novoArray[$indice][$chave] = $valor;
}
}
If you want to test, just copy and paste this code and play here on http://phptester.net/
Opa Anderson Carlos Woss, this solution there served, thanks for the tip!
– Jorgito da Silva Paiva