Many times, you require to get maximum key value of your array but you try to get with loop and any function etc, but in bellow example you can see we can get big key value from our php array by using max() and array_keys(). So, let us try to use in your code this way:

Example 1

<?php
            $arr = array( 1 => "A", 10 => "B", 5 => "C" );
max(array_keys($arr));
            ?>

Example 2

<?php
            $abc= ['2'=>'dharmik','4'=>'sanket','1'=>'fenil','3'=>'ved'];
$new_key = max(array_keys($abc));
$new_val = $abc[$new_key];
print_r($new_val);
?>