Easy, first you RTFM (there are some great functions for handling arrays in PHP.)
See these functions:
array_unique()
implode()
You can do something like this:
$arr = array_unique($arr);
print implode(":",$arr);
You can use implode to build some pretty nice html.