in_array — 检查数组中是否存在某个值.
用递归来检验多维数组
array(2) {
[0]=>
array(1) {
["bankcard"]=>
string(19) "6212260200176770626"
}
[1]=>
array(1) {
["bankcard"]=>
string(19) "6217002430037113726"
}
}
$aa = 6217002430037113726;
$att = $g_att;
public function deep_in_array($value, $array) {
foreach($array as $item) {
if(!is_array($item)) {
if ($item == $value) {
return true;
} else {
continue;
}
}
if(in_array($value, $item)) {
return true;
} else if($this->deep_in_array($value, $item)) {
return true;
}
}
return false;
}