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
....