I have an array that looks like:
Array ( [2.5] => ABDE [4.8] => Some other value )
How would I find any key/value pair where the k
To get just the part of the array with matching keys you could also write
$matching_array = array_flip(preg_grep($pattern, array_flip($your_array)));
This might just lead to problems performance-wise, if your array gets too big.