Answers for "faster way to find max in php"

PHP
0

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;
?>
Posted by: Guest on November-18-2021
-1

php max

echo max(2, 3, 1, 6, 7);  // 7
echo max(array(2, 4, 5)); // 5
Posted by: Guest on February-27-2021

Code answers related to "faster way to find max in php"

Browse Popular Code Answers by Language