i've got the following array:
$comments = array();
$comments[] = array('member_id' => '17',
'time' => '2011-05-10 11:10:00',
'name' => 'John Smith',
'comment' => 'Test Comment 1');
$comments[] = array('member_id' => '25',
'time' => '2011-05-10 11:26:00',
'name' => 'David Jones',
'comment' => 'Test Comment 2');
$comments[] = array('member_id' => '17',
'time' => '2011-05-10 13:15:00',
'name' => 'John Smith',
'comment' => 'Test Comment 3');
How would i go about grouping it by member_id? So I'll be able to display the comments on the page with the following formatting:
John Smith(2 comments)
- 2011-05-10 11:10:00 | Test Comment 1
- 2011-05-10 13:15:00 | Test Comment 3
David Jones(1 comment)
- 2011-05-10 11:26:00 | Test Comment 2