Answer the question
In order to leave comments, you need to log in
How to get the last key of an associative array with numeric keys?
<?
$array=array(2=> "two", 3=>"three", 5=>"five", 10=>"ten");
?>
как получить из массива последний ключ (10), не зная ключей?
<?
print $array[count($array)-1]; //выдаст "two" вместо "ten"
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question