function deep_in_array($value, $array) {
foreach($array as $item) {
if(!is_array($item)) {
if ($item == $value) {
return $item;
} else {
continue;
}
}

if(in_array($value, $item)) {
return $item;
} else if($this->deep_in_array($value, $item)) {
return $item;
}
}
return false;
}

加入配置的值有多个子数组,改造下

  /**
* @param $value
* @param $array
* @return bool
* 某个值是否存在于多维数组中
*/
public function deep_in_array($value, $array)
{
$total =[];
foreach ($array as $item) {
if (!is_array($item)) {
if ($item == $value) {
return $item;
} else {
continue;
}
}
if (in_array($value, $item)) {
$total[] = $item;

} else if ($this->deep_in_array($value, $item)) {
$total[] = $item;
}

}
return $total;

}