php array filter
Hi i would like to filter array in php. for example
$a = ARRAY('a', 'b', 'c', 'd', 'e');
$b = ARRAY('c', 'd');
$a will be filtered by values in array开发者_开发百科 $b
and result is ['a', 'b', 'e']
may I know how to do it in php?
Thank you.
try array_diff()
;
http://php.net/manual/en/function.array-diff.php
Regards, Gabriel
$result = array_diff($a, $b)
精彩评论