I have a while loop where I am returning departments. I want to be able to determine if it is the first time a department is returned. The code is as follows:

```
$myArray = array('Finance', 'Marketing', 'Customer Service', 'Marketing', 'Marketing', 'IT', 'Finance', 'IT');
while(list ($key, $val) = each ($myArray))
{
    echo $val . "<br />";
}

```

The above code outputs the below:

Finance

Marketing

Customer Service

Marketing

Marketing

IT

Finance

IT

Is there a way where I can have it output the following?:

Finance(first)

Marketing(first)

Customer Service(first)

Marketing

Marketing

IT(first)

Finance

IT