【发布时间】:2013-09-02 11:02:28
【问题描述】:
当我知道id 值时,如何获得tester 值。
例如,我知道 id 是 71,所以我想获取 tester 值 '34,21'。
非常感谢提前
Array (
[0] => Array (
[id] => 74
[tester] => (55, 34)
)
[1] => Array (
[id] => 71
[tester] => (34, 21)
)
)
【问题讨论】:
-
这是很多反对意见:/
-
@Ben 但不赞成投票。
-
@Leri Fair downvotes 将提供反馈
-
echo current(array_filter($array, function($i) use ($id) { return $i['id'] == $id; }))['tester'];如果你喜欢单行。 :D -
@Ben Hovel 向下箭头并阅读提示文本。 ;)