Opens in a new tab
A picture of Jeff Brigman
I CODE TODAY FOR
A BETTER TOMORROW

Glossary Term

array_unique()

3 tags 1 category

array_unique() — Removes duplicate values from an array.

array_unique() — Takes an input array and returns a new array without duplicate values.

Note that keys are preserved. If multiple elements compare equal under the given flags, then the key and value of the first equal element will be retained.

Inputs: array: The input array. flags: The optional second parameter flags may be used to modify the comparison behavior using these values: Comparison type flags: SORT_REGULAR – compare items normally (don’t change types) When combining SORT_REGULAR with arrays mixing numeric and non-numeric strings, the sort-then-compare algorithm may not place equal elements adjacent, which can leave duplicates in the result. Use SORT_STRING to avoid this.

Returns: Returns the filtered array.

Term Connections

Explore related terms connected by shared tags, shared categories, and relationship phrases. This map loads only when it comes into view.

Loading term connections…