Reputation: 6167
I would like to filter an array.
$a = ['a', 'b', 'c', 'd', 'e'];
$b = ['c', 'd'];
$a
will be filtered by values in array $b
and the result should be:
['a', 'b', 'e']
Upvotes: 0
Views: 1015
Reputation: 481
Try array_diff()
;
PHP Documentation: http://php.net/manual/en/function.array-diff.php
Upvotes: 9