Write a PHP function that returns the lowest integer that is not 0
<?php function min_values_not_zero(Array $values) { return min(array_diff(array_map('intval', $values), array(0))); } print_r(min_values_not_zero(array(-1,0,1,12,-100,1))."\n"); ?>
Sample Output:
-100
total answers (1)
start bookmarking useful questions and collections and save it into your own study-lists, login now to start creating your own collections.
Sample Output:
need an explanation for this answer? contact us directly to get an explanation for this answer