Write a PHP script to get the largest key in an array?
You can use rsort()
to get the highest value in the array.
Also Read: 5 Reasons PHP is the Most Preferred Language
BY Best Interview Question ON 07 Apr 2020
Example
$array = array('5','2','8','4');
$result = rsort($array);
//OUTPUT : 8