$galleries = array (
'0' => array ('post_id' => 300, 'photo_id' => 1),
'1' => array ('post_id' => 300, 'photo_id' => 2),
'2' => array ('post_id' => 300, 'photo_id' => 3),
'3' => array ('post_id' => 301, 'photo_id' => 4),
'4' => array ('post_id' => 301, 'photo_id' => 5),
'5' => array ('post_id' => 302, 'photo_id' => 6),
'6' => array ('post_id' => 302, 'photo_id' => 7),
'7' => array ('post_id' => 302, 'photo_id' => 8),
'8' => array ('post_id' => 302, 'photo_id' => 9),
'9' => array ('post_id' => 303, 'photo_id' => 10),
'10' => array ('post_id' => 303, 'photo_id' => 11),
'11' => array ('post_id' => 304, 'photo_id' => 12),
)
我想post_id
用 HTML 或 PHP 将它分组并打印成这样的:
300 = 1,2,3
301 = 4,5
302 = 6,7,8,9
303 = 10,11
304 = 12