求教一个关于数组取值的问题
现有一个数组:(
=> Array
(
=> 107
=> 65282
=> 139
=> 4
=> 18
=> 2020-12-25 16:23:18
)
=> Array
(
=> 108
=> 65282
=> 139
=> 5
=> 19
=> 2020-12-25 16:23:18
)
=> Array
(
=> 109
=> 65282
=> 139
=> 6
=> 16
=> 2020-12-25 16:23:18
)
=> Array
(
=> 110
=> 65282
=> 139
=> 7
=> 18
=> 2020-12-25 16:23:18
)
)我想获取aid=139且sid=4的数组中score的值。该如何获取呢?不能用循环或遍历。谢谢!!
楼主生成数组的时候能不能把这两列生成一个字段
=> Array
(
=> 110
=> 65282
=> 139
=> 7
=> 18
=> 2020-12-25 16:23:18
=> 139_7
)
这样的话可以用$brr = array_column($Arr,'aid_sid');
$brr['139_7']['score']就是你要的值
页:
[1]