need help grouping a php array

Chester

New Member
i've got a mysql query which spits out the following array:\[code\]Array( [0] => stdClass Object ( [item1] => foo 0 [item2] => bar 0 [catid] => 3 ) [1] => stdClass Object ( [item1] => foo 1 [item2] => bar 1 [catid] => 7 ) [2] => stdClass Object ( [item1] => foo 2 [item2] => bar 2 [catid] => 10 ) [3] => stdClass Object ( [item1] => foo 3 [item2] => bar 3 [catid] => 7 ))\[/code\]I was wondering if it was possible to group the array by "category", so instead of duplicate catids, there would be one catid with each object inside it.. if that makes sense? So say catid 7 would only appear once, with the two item1/item2 inside it.
 
Back
Top