$min=1;$max=20;$data=range($min,$max);$count=count($data);$res=0;for($i=0; $i<$count; $i++){ $res+=$data[$i];}echo $res,'<hr>';
以上为for循环