Signatur
array_unique(array $array, int $flags = SORT_STRING): array
Beschreibung
Standard-Vergleich als String. Für strikten Vergleich: SORT_REGULAR.
Parameter
| Name | Typ | Default | Beschreibung |
|---|---|---|---|
| $array Pflicht | array | — | Eingabe. |
| $flags | int | SORT_STRING | Vergleichsmodus. |
Rückgabewert
Typ
array
Beschreibung
Array ohne Duplikate.
Beispiele
Duplikate raus
<?php
print_r(array_unique(['a', 'b', 'a', 'c', 'b'])); // ['a', 'b', 3=>'c']