Getting min and max values ​​from PHP array

Is there a PHP built-in function that will allow you to get the min and max values ​​from a PHP array?

If not, what's the most efficient way to do this for the general case?

+2


source to share


3 answers


min and max .



$array = array(1, 2, 3);

$min = min($array);
$max = max($array);

      

+12


source


Max Min



+2


source


Yes there is. min () and max ()

+2


source







All Articles