2

Is there a built in PHP function that will allow you get the minimum and maximum values from a PHP array?

If not, what's the most efficient way of doing this for the general case?

3 Answers 3

11

min and max.

$array = array(1, 2, 3);

$min = min($array);
$max = max($array);
Sign up to request clarification or add additional context in comments.

Comments

2

Max Min

Comments

2

Yes there is. min() and max()

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.