Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

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 by tutorialdeep.com #
 
PREVIOUS NEXT
Tagged: #php #max #associative #array
ADD COMMENT
Topic
Name
7+8 =