我有一个看起来像这样的数组:
Array
(
[100] => Array
(
[room_id] => 100
[name] => Town Center
)
[110] => Array
(
[room_id] => 110
[name] => Coffee Shop
[pin_id] => 7146
[pin_x] => 570
[pin_y] => 150
)
)
我想知道是否有一种方法可以找到特定值的键,如果“pin_id”值存在的话。例如:
Array
(
[100] => Array
(
[room_id] => 100
[name] => Town Center
)
[110] => Array <- I want to get this key "110"
(
[room_id] => 110
[name] => Coffee Shop
[pin_id] => 7146 <- Because "pin_id" is here
[pin_x] => 570
[pin_y] => 150
)
)