How to Get Lowest Value in PHP Array?

03-Apr-2023

.

Admin

How to Get Lowest Value in PHP Array?

Hi Dev,

This tutorial is focused on how to get the lowest value in a PHP array. you'll learn how to find the minimum value in the array. We will use how to find the min value in a PHP array. if you have a question about how to find the lowest element in the array then I will give a simple example with a solution.

Now, let's see the article on how to get the lowest element in a PHP array. it's a simple example of how to get the minimum element in the array. you can understand the concept of how to find the lowest element in a PHP array. if you have a question about how to get the minimum value in the array then I will give a simple example with a solution.

Example:


index.php

<?php

$myArray = [1, 2, 4, 5, 6, 7, 8, 9, 10, 11, 12];

/* Getting the lowest Element from PHP Array */

$newArray = min($myArray);

print_r($newArray);

?>

Output:

1

I hope it could help you...

#PHP