How to Get Max Value an Array in PHP?
Hi Dev,
This tutorial will give you an example of how to get the max value of an array in PHP. you can understand the concept of how to get the max value of an array in PHP. step by step explain how to get the maximum value of an array in PHP. this example will help you how to get the max value of a PHP array.
In this tute, we will discuss how to get the max value of an array in PHP. you'll learn how to get the max value of an array in PHP. you can see how to get the maximum value of an array in PHP. Here you will learn how to get the max value of a PHP array. Alright, let’s dive into the steps.
Example 1:
index.php
<?php
echo(max(2,42,60,85,100));
?>
Output:
100
Example 2:
index.php
<?php
echo(max(array(40,13,88,92)));
?>
Output:
92
I hope it could help you...
- How To Use Php Conditional Statement Example
- How to Check if String Contains Regex in PHP?
- PHP Array_column() Function Example
- PHP Generate List of Random Numbers Between 0 and 100 Example
- How to User Login with Facebook in PHP?
- How to Explode Every Character into Array Using PHP Example?
- PHP Form Validation Tutorial
- PHP Convert XML to JSON Example