Hi Jamie
yeah stripping all the zero items then using min is the other way i would use.
//just using this as an example array to illustrate
$numarray = array (19, 0, 4, 39, 17);
//set a minimum, start at the maximum number in the array
$currentmin = max($numarray);
//loop through each item in array, setting $num equal to the current item
//so this will go $num = 19, $num = 0, etc etc
foreach($numarray AS $num){
//if num isn't zero (ie ignore it if the array item is zero)
if($num != 0){
//if num is less than current minimum
if($num < $currentmin){
//set mimimum to num
$currentmin = $num;
//note if the num is not less than the current minumum, there is no change
} //end if
} //end the other if
} //loop to the next array item, or end the loop
//echo the minimum
echo "Minimum non-zero is " . $currentmin;
any more questions?
is that you in the pic? you're pretty! :rolleyes:
adam