2
I don’t want to use foreach and neither 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
)
)
Obs: I don’t want anything like that either:
foreach ($items as list($var1, $var2, $var3)) {
if ($var1 == $var2) {
echo $var3;
}
}
The goal is to improve the structure.