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

La función max() en PHP

Estemax()La función devuelve el valor máximo del array.

Sintaxis

max(arr_values);
o
max(val1,val2,...);

parámetro

  • arr_values-es un array con valores.

  • val1,val2-los valores a comparar.

devuelve

Estemax()La función devuelve el valor máximo del array.

Ejemplo

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

Resultado de salida

89

Ejemplo

Veamos otro ejemplo-

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

Resultado de salida

89