I have an array like this:
$a = array(
0 => array('type' => 'bar', 'image' => 'a.jpg'),
1 => array('type' => 'food', 'image' => 'b.jpg'),
2 => array('type' => 'bar', 'image' => 'c.jpg'),
3 => array('type' => 'default', 'image' => 'd.jpg'),
4 => array('type' => 'food', 'image' => 'e.jpg'),
5 => array('type' => 'food', 'image' => 'f.jpg'),
6 => array('type' => 'food', 'image' => 'h.jpg')
)
How do I figure out unique type values (which would be food, bar and default)? I could iterate through the array in a foreach loop but is there a better way doing it?