时间:2021-07-01 10:21:17 帮助过:7人阅读
function search($keyWord, $stack) {//此处判断是应该更新还是插入
foreach ($stack as $key => $val) {
if (in_array($keyWord, $val)) {
return TRUE;
}
}
return FALSE;
}
多维数组
www.2cto.com
function search($array, $v) {
$data = array();
foreach ($array as $key => $value) {
if (is_array($value)) {
$result = test($value, $v);
if (!empty($result)) {
$data[$key] = $result;
}
} else {
if ($value == $v) {
$data[$key] = $v;
}
}
}
return $data;
}
作者 heicm
http://www.bkjia.com/PHPjc/478496.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/478496.htmlTechArticle二维数组 function search($keyWord, $stack) {//此处判断是应该更新还是插入 foreach ($stack as $key = $val) { if (in_array($keyWord, $val)) { return TRUE; } } return...