I have one large multidimensional array, which I got from database with picture locations
Array
(
[0] => Array
(
[name] => 01.jpg
[album] => /images/beach
)
[1] => Array
(
[name] => 02.jpg
[album] => /images/beach
)
[2] => Array
(
[name] => 03.jpg
[album] => /images/home
)
)
i am trying to split it into smaller arrays that match the albums, as below:
Array
(
[0] => Array
(
[name] => 01.jpg
[album] => /images/beach
)
[1] => Array
(
[name] => 02.jpg
[album] => /images/beach
)
)
Array
(
[0] => Array
(
[name] => 03.jpg
[album] => /images/home
)
)
what would be a good way to go about it? i am thinking of shifting the first value into a new array until I reach the end but there must be a more effective way.