我有一个PHP数组像这样(没有语法)数组元素:PHP:使用某些关键
array
(
['one'] => array (
['wantedkey'] => 5
['otherkey1'] => 6
['otherkey2'] => 7
)
['two'] => => array (
['otherkey1'] => 5
['otherkey2'] => 6
['wantedkey'] => 7
)
['three'] => => array (
['otherkey1'] => 5
['wantedkey'] => 6
['otherkey2'] => 7
)
)
什么是打印值只与'wantedkey'
一个关键要素的最佳方式,如果我例如使用array_walk_recursive
?
谢谢!
道歉,我忘了提,如果我要检查,如果键是在多维的方式是相同的: '$项目[“wantedkey1”] [“wantedkey2”]' 如何确保两个钥匙都存在? – ash 2009-12-23 18:52:36