// pseudo-code
$prevState = "";
while( printing out the list)
{
if($currentstate != $prevState)
{
echo the state
}
echo golf course name
$prevState = $currentstate;
}
the idea is to keep track of the one before it. Test the current one with the previous one. If its the same, don't do anything and continue. If it is not the same, then print the state name.