UTILITY

unique()

Remove duplicate values while preserving first occurrence order.

Signature

array unique(array $array, bool $strict = true)

Example

unique([1, 1, 2, 3, 3]); // [1, 2, 3]

Available from: 1.5.0

Reference navigation

Previous: truncate()

Next: url_host()

Back to utilities