Dmytro Zarezenko - 6 months ago 51

PHP Question

There are 3 operations with sets in mathematics: intersection, difference and union (unification). In PHP we can do this operations with arrays:

- intersection:
`array_intersect`

- difference:
`array_diff`

No duplicates can be in the result array (like

`array_intersect`

`array_diff`

If indexes are numeric then

`array_merge`

Source (Stackoverflow)