This question already has an answer here:
I'm not sure if it's possible to do it with in_array. What I need is to verify that all given values exist in array. For example:
$a = array(1,2,3,4,5,6,7,8,9,10)
$b = array(1,2,3);
if(in_array($b, $a)) {
return true
} else {
return false
}
Note that all the values from $b must exist in $a in order to return true.
$b
in foreach and than test within_array
? – panther Jun 5 '14 at 18:55array_intersect
orarray_diff
– Deadooshka Jun 5 '14 at 18:56