foreach ($arr as $key => $value) {
foreach ($arr_ as $key_ => $value_) {
$dev[$value_][] = array_search($value_, $arr[$key]);
}
}
我需要从数组搜索中排除所有布尔值 false,但保留原始键。所以,这就是我想要的 AAAA。我怎样才能做到这一点?
'AAAA' =>
array
1 => int 0
3 => int 1
5 => int 1
7 => int 2
9 => int 1
11 => int 2
13 => int 2
15 => int 3
我有的:
array
'AAAA' =>
array
0 => boolean false
1 => int 0
2 => boolean false
3 => int 1
4 => boolean false
5 => int 1
6 => boolean false
7 => int 2
8 => boolean false
9 => int 1
10 => boolean false
11 => int 2
12 => boolean false
13 => int 2
14 => boolean false
15 => int 3
'BBBB' =>
array
0 => boolean false
1 => boolean false
2 => int 0
3 => int 0
4 => boolean false
5 => boolean false
6 => int 1
7 => int 1
8 => boolean false
9 => boolean false
10 => int 1
11 => int 1
12 => boolean false
13 => boolean false
14 => int 2
15 => int 2
'CCCC' =>
array
0 => boolean false
....