Menu Samaritan's Purse

MAX

Find highest value

SYNTAX

max ( array $values ) : mixed
max ( mixed $value1 [, mixed $... ] ) : mixed

PARAMETERS

values

An array containing the values.

value1

Any comparable value.

...

Any comparable value.

RETURN

max() 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. If an empty array is passed, then FALSE will be returned and an E_WARNING error will be emitted.

EXAMPLES

VALUES

3

VALUE1 ...

3

FIRST

int(0)

FIRST

int(1)

FIRST

0

LENGTH

Array
(
    [0] => 1
    [1] => 2
    [2] => 3
)

LEFT TO RIGHT

Array
(
    [0] => 3
    [1] => 2
    [2] => 1
)

PHP