min() function in PHP


The min() function Returns the minimum value of an array.

Syntax

min(arr_values);
or
min(val1,val2,...);

Parameters

  • arr_values − The array with values.

  • val1, val2 − The values to compare.

Return

The min() function Returns the minimum value of an array.

Example

 Live Demo

<?php
   echo (min(70, 89, 12, 34, 23, 66, 34));
?>

Output

12

Example

Let us see another example −

 Live Demo

<?php
   echo (min(array(70, 89, 12, 34, 23, 66, 34)));
?>

Output

12

karthikeya Boyini
karthikeya Boyini

I love programming (: That's all I know

Updated on: 27-Dec-2019

77 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements