I have an array of 200 items. I would like to output the array but group the items with a common value. Similar to SQL\'s GROUP BY method. This should be relatively easy to
$groups = array(); foreach($items as $item) $groups[$item['value']][] = $item; foreach($groups as $value => $items) echo 'Group ' . $value . ' has ' . count($items) . ' ' . (count($items) == 1 ? 'item' : 'items') . "\n";