Get Maximum Value from string Key PHP Array
Thanks for visiting.
Web Technology
PHP, X/HTML, Javascript, CSS, Ajax, SEO and XML
Blog for Web Developers.
Mar 16, 2008
Recent Posting
1 Comments:
There is a trick you can do...
Considering $array1 as the array which you wish the maximum key value, you can do:
$array_max = array_keys($array1);
$key_max = max($array_max);
Just remembering: array_keys returns all the keys from the specified array in a new array. And the function max returns the maximum value of the array.
Hope it helped.
Post a Comment