public function unique(array $elements, Closure $iterator = null)
    {
        if ( ! is_null($iterator))
        {
            $elements = array_filter($elements, $iterator);
        }
        else
        {
            $elements = array_unique($elements);
        }

        return array_values($elements);
    }
public function unique(array $elements, Closure $iterator = null)
    {
        if ( ! is_null($iterator))
        {
            $elements = array_filter($elements, $iterator);
        }
        else
        {
            $elements = array_unique($elements);
        }

        return array_values($elements);
    }
public function unique ( array $ elements , Closure $ iterator = null ) { if ( ! is_null ( $ iterator ) ) { $ elements = array_filter ( $ elements , $ iterator ) ; } else { $ elements = array_unique ( $ elements ) ; } return array_values ( $ elements ) ; }
Remove duplicated values.

@param array $elements
@param Closure|null $iterator
@return array
Remove duplicated values .