Check if current element is less than then update third
else if ( $ array [ $ i ] < $ thirdmin ) $ thirdmin = $ array [ $ i ] ; } echo " First min = " . $ firstmin . " " ; STRNEWLINE echo ▁ " Second min = " . $ secmin . " " ; STRNEWLINE echo ▁ " Third min = " . $ thirdmin . " " }