Deprecated: implode(): Passing glue string after array is deprecated. Swap the parameters in /home/ct33h8azxpia/public_html/wp-content/themes/aquarella-lite/single.php on line 94
Write a Program for Find the smallest number in an array using PHP - Experts PHP

Write a Program for Find the smallest number in an array using PHP

Hello guys today i will tell you through this tutorial how you can find small number from any array through php program.

How to Find the Smallest Number in an Array in PHP, Find the smallest elements in an array using PHP, How to find minimum value of an array With PHP

<?php
$numbers = array(2,17,40,22,5,6,14,7,19,54);
$length = count($numbers);
$min = $numbers[0];
for($i=1;$i<$length;$i++)
{
if($numbers[$i]<$min)
{
$min=$numbers[$i];
}
}
echo "The smallest number is ".$min;
?>