I have a query using a join on 2 tables which returns something like this :
Array
(
[0] => Array
(
[id] => 1
[description] => 'Test'
[image] => '1.jpg'
)
[1] => Array
(
[id] => 1
[description] => 'Test'
[image] => '2.jpg'
)
[2] => Array
(
[id] => 2
[description] => 'Test 2'
[image] => '11.jpg'
)
)
Is there a way to get an Array like this one :
Array
(
[0] => Array
(
[id] => 1
[description] => 'Test'
[image] => array('1.jpg', '2.jpg')
)
[2] => Array
(
[id] => 2
[description] => 'Test 2'
[image] => '11.jpg'
)
)
I want to group some indexes. For now, I use a loop and a if condition. But I want to know if someone use an other way.