Is there a one liner for finding an integer key equal to or greater than a given index? To make things clear, here's an example of an array I'm working with.
array( 4294967295 => 'LONGTEXT'
, 16777215 => 'MEDIUMTEXT'
, 65535 => 'TEXT'
, 255 => 'TINYTEXT' );
As some of you may recognize, these are MySQL
column definition types. Let's say I'm given an integer 500
, how can I quickly/compactly find the next key of 65535
which maps to 'TEXT'
?
Currently I iterate the array using foreach
(hence highest values first) and track the last key. But, due to the number of arrays and data types I'm dealing with, the function has become bloated.