I've this multidimensional array in PHP:
Array
(
[0] => Array
(
[continent] => Europa
[country] => France
[capital] => Paris
)
[1] => Array
(
[continent] => Europa
[country] => Spain
[capital] => Madrid
)
[2] => Array
(
[continent] => Asia
[country] => Russia
[capital] => Moscow
)
)
How can I group countries depending the continent ?
So countries in the same continent should be group together.
The desired output should be:
Array
(
[Europa] => Array
(
[country] => France
[capital] => Paris
),
(
[country] => Spain
[capital] => Madrid
)
[Asia] => Array
(
[country] => Russia
[capital] => Moscow
)
)
How it is possible with PHP please ?
Thanks.