标签: php arrays
$array = [0,1,2,3,4,5,6]; $min = min($array); $max= max($array);
答案 0 :(得分:7)
使用array_filter过滤数组中的零值
$a = array(0,1,2,3,4,5,6); $a = array_filter($a); $min = min($a); $max = max($a);
答案 1 :(得分:0)
将array_shift用于0,将array_pop用于最后