take the highest value for a same key php code example
Example: php get highest key value
$arr = array( 1 => "A", 10 => "B", 5 => "C" );
max(array_keys($arr));
$arr = array( 1 => "A", 10 => "B", 5 => "C" );
max(array_keys($arr));