There are three way to find min value in array

Using max function

<?php
$array = array(44,16,81,12);
echo(min($array));
?>

OUTPUT: 12

Using foreach loop

<?php
$array = array(44,16,81,12);

foreach($array as $value) {
	if($value < $b) {
		$b = $value;
	}
}
echo $b;
?>

OUTPUT: 12

Using for loop

<?php
$array = array(44,16,81,12);

$b = 0;
for($i=0;$i<count($array); $i++) {
	if($array[$i] < $b) {
		$b = $array[$i];
	}
}
echo $b;
?>

OUTPUT: 12