特定值我有一個數組,我想找個地方correct => true
所有值:搜索在陣列
$quiz_array = array (
'question1' => array (
'q1a1' => array (
'correct' => FALSE,
'answer' => 'false answer1'
),
'q1a2' => array (
'correct' => FALSE,
'answer' => 'false answer2'
),
'q1a3' => array (
'correct' => FALSE,
'answer' => 'false answer3'
),
'q1a4' => array (
'correct' => TRUE,
'answer' => 'correct answer'
)
)
);
我想做一個搜索,它會在這種情況下返回q1a4
,因爲correct => TRUE
。我使用in_array
和array_search
,但沒有運氣。有什麼建議麼?
'的foreach' ....... – zerkms 2013-05-03 10:12:12
可能重複的[查找多維數組的值](http://stackoverflow.com/questions/10811908/find-values-in-multidimensional-arrays) – JJJ 2013-05-03 10:13:23