How to search by key=>value in a multidimensional array in PHP

前端 未结 15 2312
闹比i
闹比i 2020-11-22 00:13

Is there any fast way to get all subarrays where a key value pair was found in a multidimensional array? I can\'t say how deep the array will be.

Simple example arra

15条回答
  •  孤城傲影
    2020-11-22 00:40

    if (isset($array[$key]) && $array[$key] == $value)
    

    A minor imporvement to the fast version.

提交回复
热议问题