← All built-ins / array_diff()
array_diff()
array_diff(...$args): mixed
Parameters
| Name | Type | Description |
|---|---|---|
| $... | array | first the base array, then arrays of values to exclude |
Return value
Values of the first array that appear in none of the others.
Example
echo implode(",", array_diff([1, 2, 3, 4], [2, 4]));1,3