Answers for "php array key max"

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
0

php get highest key value

$arr = array( 1 => "A", 10 => "B", 5 => "C" );
max(array_keys($arr));
Posted by: Guest on November-02-2020

Browse Popular Code Answers by Language