@unique
Remove duplicates from an array, preserving first-occurrence order.
Returns: array
Syntax
Section titled “Syntax”@unique(arr)Arguments
Section titled “Arguments”| Name | Type | Description |
|---|---|---|
arr |
array |
Source array |
Examples
Section titled “Examples”# Remove duplicatesset $arr [1 2 2 3 1 3]set $uniq @unique($arr)See Also
Section titled “See Also”- @filter — custom duplicate removal