<p>After using <a href="http://us.php.net/array_unique" rel="noreferrer"><code>array_unique</code></a>, an array without the duplicate values is removed. However, it appears that the keys are also removed, which leaves gaps in an array with numerical indexes (although is fine for an associative array). If I iterate using a for loop, I have to account for the missing indexes and just copy the keys to a new array, but that seems clumsy.</p>

```
$foo = array_values($foo);
```
will re-number an array for you