quick links

Find second highest value from array

Enter value of $n

<?php
$n = 2;
$array = array(44,16,81,12);
$unique = array();
$unique = array_unique($array);
sort($unique);
echo $height = $unique[count($unique)-$n];
?>

OUTPUT: 44

 

About Us

Joomla Web Solution

We love working with PHP, HTML5, CSS3, jQuery and the most-loved content management framework in the world, Joomla!

LIKE US ON FACEBOOK