In PHP 5.5+, how do I check if the given array of associative arrays contains specific key/value pairs. For example:
$some_array = array(
array(
"value"=> 1,
"k1"=> "austin",
"k2"=> "texas",
"k3"=> "us"
),
array(
"value"=> 15,
"k1"=> "bali",
"k2"=> "ubud",
"k3"=> "indonesia"
),
array(
"value"=> 26,
"k1"=> "hyd",
"k2"=> "telangana",
"k3"=> "india"
)
));
How do I return the value associated with k1='bali', k2='ubud' and k3='indonesia'? I can loop through each element to check if that combination exists in the array but is there a simpler way to handle this?