PHP função max ()
Exemplos
() Para encontrar o valor máximo por Max:
<?php
echo(max(2,4,6,8,10) . "<br>");
echo(max(22,14,68,18,15) . "<br>");
echo(max(array(4,6,8,10)) . "<br>");
echo(max(array(44,16,81,12)));
?>
echo(max(2,4,6,8,10) . "<br>");
echo(max(22,14,68,18,15) . "<br>");
echo(max(array(4,6,8,10)) . "<br>");
echo(max(array(44,16,81,12)));
?>
Correndo instância »
Definição e Uso
função max () retorna o valor máximo em uma matriz, ou alguns valor máximo especificado.
gramática
max( array_values );
or
max( value1,value2,... );
or
max( value1,value2,... );
参数 | 描述 |
---|---|
array_values | 必需。规定一个包含值的数组。 |
value1,value2,... | 必需。规定要比较的值(至少两个值)。 |
detalhes técnicos
retorna: | O valor máximo. |
---|---|
Tipo de retorno: | misto |
versão do PHP: | 4+ |
PHP Math Reference