Improvement: array_keys instead of array_unique .