1
我想檢查一個鍵值的多維數組並打印它的父數組的另一個鍵值。這可能會混淆一點。但是下面的例子可以說清楚。我有一個這樣的數組。檢查多維數組中的條件
Entity Response : Array
(
[0] => Array
(
[type] => FieldTerminology
[relevance] => 0.709023
[count] => 4
[text] => domain name
)
[1] => Array
(
[type] => Company
[relevance] => 0.603375
[count] => 2
[text] => Laravel
)
[2] => Array
(
[type] => Person
[relevance] => 0.548389
[count] => 1
[text] => M. Naveen Kumar
)
我要檢查是否有任何陣列具有key [type]
及其value = "Person"
,那麼我想它的key[text]
的價值。在這種情況下,我想打印M. Naveen Kumar