PHP max () function

PHP

Syntax:
max (array_values) or max (value1, value2, ...)
Parameters:this function takes two different types of arguments, which are described below:
  • array_values ​​: specifies an array containing values.
  • value1, value2 , …: specifies two or more two values ​​to compare.
  • Returned value:The max() function returns the numeric maximum value.Examples:
    Input: max (12, 4, 62, 97, 26) Output: 97 Input: max (array (28, 36, 87, 12)) Output: 87
    The following programs illustrate how max() works in PHP:Program 1: < ? php echo (max (12, 4, 62, 97, 26));  
    ?>
    Output:
    97  Program 2 :       echo  (max (  array  (28, 36, 87, 12)).  "< br >" );  
    ?>
    Output:
    87   Important points to pay attention to: 
    • The max() function is used to find the numeric maximum number.
    • The max() function can be used for two or more values, or for an array.
    • The return value is of mixed data type.
    Link :
    http://php.net/manual/en/function.max.php



    Get Solution for free from DataCamp guru