PHP逻辑 $array[0] = array(1,2,3,4,5);for ($i=1; $i 3 ; $i++) { $j = $i-1;foreach ($array[$j] as $key = $value) {if($key==0){$array[$i][$key] = $value+1;}else{$array[$i][$key] = $array[$i][0] + $array[$j][$key];}}}
$array[0] = array(1,2,3,4,5); for ($i=1; $i < 3 ; $i++) { $j = $i-1; foreach ($array[$j] as $key => $value) { if($key==0){ $array[$i][$key] = $value+1; }else{ $array[$i][$key] = $array[$i][0] + $array[$j][$key]; } } }