$all = array ( 0 => 307, 1 => 157, 2 => 234, 3 => 200, 4 => 322, 5 => 324 ); $search_this = array ( 0 => 200, 1 => 234 );
我想找出$ all是否包含所有$ search_this值并返回true或false。有什么想法吗?
看一下array_intersect()。
$containsSearch = count(array_intersect($search_this, $all)) == count($search_this);