Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

in array php multiple values

$haystack = array(...);

$target = array('foo', 'bar');

if(count(array_intersect($haystack, $target)) == count($target)){
    // all of $target is in $haystack
}

if(count(array_intersect($haystack, $target)) > 0){
    // at least one of $target is in $haystack
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #array #php #multiple #values
ADD COMMENT
Topic
Name
6+8 =