PHP: array_unique without gap !
If you use array_unique function for getting unique values in a simple array and if you need the index to be linear use this :
$unique = array_keys(array_flip($array));
This metod is about twice as fast or fast as array_unique !
Note that array_unique preserves the keys, even if the array is not associative.






















