Max () returns the maximum value syntax: the max (x, y) parameter description x is required, a number. y is required. it is a number. note: max () returns the maximum value of a parameter. if there is only one parameter and it is an array, max () returns... max () returns the maximum value.
Syntax:Max (x, y)
Parameter description
X is required. it is a number.
Y is required. it is a number.
Note:Max () returns the maximum value of a parameter.
If there is only one parameter and it is an array, max () returns the maximum value of the array. if the first parameter is an integer, string, or floating-point number, at least two parameters are required, while max () the maximum value of these values is returned, which can be an unlimited number of values. the instance code is as follows:
Echo max (1, 3, 5, 6, 7); // return 7 echo"
"; Echo max (array (2, 4, 5); // returns 5 echo"
"; Echo max (0, 'Hello'); // return 0 echo"
"; Echo max ('hello', 0); // return hello echo"
"; Echo max (-1, 'Hello'); // return hello echo"
"; $ Val = max (array (2, 4, 8), array (2, 5, 7); // returns the second array print_r ($ val); echo"
"; $ Val = max ('string', array (, 7), 42); // returns an array
Min () returns the minimum value.
Syntax:Min (x, y)
Parameter description
X is required. it is a number.
Y is required. it is a number.
Note:Min () returns the smallest value in the parameter.
If there is only one parameter and it is an array, min () returns the smallest value in the array. if the first parameter is an integer, string, or floating-point number, at least two parameters are required and min () returns the smallest of these values. you can compare them with an infinite number of values. the instance code is as follows:
Echo min (2, 3, 1, 6, 7); // 1 echo"
"; Echo min (array (2, 4, 5); // 2 echo"
"; Echo min (0, 'Hello'); // 0 echo"
"; Echo min ('hello', 0); // hello echo"
"; Echo min ('hello',-1); //-1 echo"
"; $ Val = min (array (2, 4, 8), array (2, 5, 1); // return the first array print_r ($ val); echo"
"; $ Val = min ('string', array (2, 5, 7), 42); // return string print_r ($ val );
Tutorial address:
Reprinted! But please include the article address ^