我想检查一个数组是否没有其他值比其他值,但in_array()没有工作,所以我想它不能用in_array()完成;PHP检查一个数组是否没有其他数组比其他值
例如
<?php
$arr1 = array(1,2,3,4,5,6);
$arr2 = array(1,2,9);
if(/*all values in $arr2 are in $arr1*/){
/*return true*/
}
else{
/*return false*/
}
/*this examle should return false*/
?>
或
<?php
$arr1 = array(1,2,3,4,5,6);
$arr2 = array(1,2,6);
if(/*all values in $arr2 are in $arr1*/){
/*return true*/
}
else{
/*return false*/
}
/*this examle should return true*/
?>
我该怎么办呢?
有数组功能这样的失衡:array_merge,和array_diff,array_intersect,等... – 2014-10-03 18:05:35