我有一个像这样的多维数组:
Array
(
[0] => Array
(
[name] => >chr1:2198584545754_genome_1000+
[score] => 511
[hit] => 50
)
[1] => Array
(
[name] => >chr2:2198581212154_genome_1000+
[score] => 620
[hit] => 80
)
[2] => Array
(
[name] => >chr3:2115151215754_genome_1000+
[score] => 666
[hit] => 90
)
[3] => Array
(
[name] => >chr4:2198584545754_genome_1000+
[score] => 750
[hit] => 50
)
[4] => Array
(
[name] => >chr5:1218455145754_genome_1000+
[score] => 800
[hit] => 100
)
[5] => Array
(
[name] => >chr6:1231354645454_genome_1000+
[score] => 850
[hit] => 110
)
[6] => Array
(
[name] => >chr7:1231213211134_genome_1000+
[score] => 900
[hit] => 120
)
)
我有一个 foreach 循环,它将遍历随机序列的每个字母,并使用索引给每个字母一个数字值。如果 ['hit'] 的值与随机序列的索引值匹配,我想插入一个函数。
我无法弄清楚这一点。我认为我的问题在于调用 ['hit'] 的每个值并与索引进行比较。有谁知道如何做到这一点 ?谢谢