English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

min() function in PHP

Thismin()The function returns the minimum value of the array.

Syntax

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

parameter

  • arr_values-has an array with values.

  • val1,val2-the values to be compared.

returns

Thismin()The function returns the minimum value of the array.

Example

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

Output Result

12

Example

Let's look at another example-

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

Output Result

12