php max value in associative array
<?php $myarrayassoc = array("Cycles" => 3, "Bikes" => 6, "Cars" => 11); $value = max($myarrayassoc); $key = array_search($value, $myarrayassoc); echo "The max value is: ".$value.", its key is: ".$key; ?>
Source: tutorialdeep.com
php get max key in associative array
$array = array(0 => "-1121", 1 => "-1605", 2 => "100", 3 => "55"); echo max(array_keys($array)); ///OUTPUT: 3