I do not want to use foreach and for . For example, I have the following array structure:
Array
(
[0] => Array
(
[0] => Array
(
[id_usuario] => 1
)
[1] => Array
(
[idade] => 21
)
)
[1] => Array
(
[0] => Array
(
[id_usuario] => 2
)
[1] => Array
(
[idade] => 15
)
)
)
But I would like my array to look like this:
Array
(
[0] => Array
(
[id_usuario] => 1
[idade] => 21
)
[1] => Array
(
[id_usuario] => 2
[idade] => 15
)
)
Note: I also do not want anything similar to this:
foreach ($items as list($var1, $var2, $var3)) {
if ($var1 == $var2) {
echo $var3;
}
}
The goal is to improve the structure.