Find Minimum value of an array - phptpoint

Find Minimum value of an array

Best PHP Training with Live Project in Noida Fee is only 7500/-Click here for FREE DEMO.


How to find minimum value of an array.



First create an array with some numeric value.

Now create a temporary variable $temp in which stored array’s first index’s value i.e 100.

Now to display/fetch array’s all value from start to end used foreach loop. Inside foreach create a temporary variable $x which holds array values.

Now add a condition in body of foreach to check $x is less than $temp then assign $x value to $temp variable this process will contiue till end of array.
after completion of foreach loop $temp variable has minimum value from array $arr.

Now print mininum value.

Keep Updating yourself