I have a nested array with valid numbers => data:-
$validData = array(array(1 => 'one data'),array(5 => '5 data'),array(15 => '15 data'),array(30 => 'thirty data'));
Let say I have a query value, $query = 14;
I want to first check if there's a 14, if not then go to the nearest option ABOVE.
I've been doing nearest item with max, array_keys and ranges. But, matching or going above for some reason I can't see the best way?
key($item) <= $query.