Grab array value if a specific key is there with PHP

后端 未结 3 1994
醉梦人生
醉梦人生 2021-01-27 22:49

I have an array that looks something like this:

Array
(
    [100] => Array
        (
            [room_id] => 100
            [name] => Town Center
             


        
3条回答
  •  囚心锁ツ
    2021-01-27 23:15

    foreach ($your_big_array as $arr) {
        if ($arr['pin_id'] == 'some_value') $i_need_this = $arr['name'];
    }
    

提交回复
热议问题