❮ Tham khảo toán học PHP
Thí dụ
Tìm giá trị cao nhất với hàm tối đa []:
Hãy tự mình thử »
Định nghĩa và cách sử dụng
Hàm Max [] trả về giá trị cao nhất trong một mảng hoặc giá trị cao nhất của một số giá trị được chỉ định.
Cú pháp
tối đa [mảng_values];
hoặc
max[value1,value2,...];
Giá trị tham số
Array_Values | Yêu cầu. Chỉ định một mảng chứa các giá trị |
value1, value2, ... | Yêu cầu. Chỉ định các giá trị để so sánh [phải có ít nhất hai giá trị] |
Chi tiết kỹ thuật
Giá trị cao nhất về mặt số |
Trộn |
4+ |
❮ Tham khảo toán học PHP
Johnphayes tại Gmail Dot Com ¶
16 năm trước — Find highest value
MichaelAngel0 tại mail.com
15 năm trước
PHP tại rijkvanwel dot nl ¶[array $value_array
]:
mixed
11 năm trước:
Mặt trời tại Drupal Dot org ¶string will be compared to an int as though it were
0
, but multiple non-numeric string values will be compared alphanumerically. The actual value returned will be of the original type with no conversion applied.
0
6
người điều hòa ¶max[] can produce unpredictable results.
Thông tin tại Osworx Dot Net
3 năm trướcLevim tại php dot net ¶
'abc'
3blackmac01 tại gmail dot com
Toon Dot Baeyens tại Gmail Dot Com ¶Chris tại Candm DT org DT UK ¶
1 năm trước
Michael Blinn ¶ returns the parameter value considered
"highest" according to standard comparisons. If multiple values of different types evaluate as equal [e.g. 0
and 'abc'
] the first provided to the function will be returned.
[Php 4, Php 5, Php 7, Php 8]false
will be returned and an E_WARNING
error will be emitted.
Ví dụ
Ví dụ #1 Ví dụ sử dụng Max []max[]