📜  在数组 php 中的多个值 - PHP 代码示例

📅  最后修改于: 2022-03-11 14:54:00.550000             🧑  作者: Mango

代码示例2
$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
}