abstract:$min = 0; $max = 10; $data = range($min,$max); $res = 0; $count = count($data);1、使用forfor($i=0; $i<$count; $i++){  
$min = 0; $max = 10; $data = range($min,$max); $res = 0; $count = count($data);
1、使用for
for($i=0; $i<$count; $i++){ $res += $i; } echo $res;
2、使用while
$i = 0; while($i < $count){ $res += $i; $i++; } echo $res;
3、使用foreach
foreach($data as $value){ $res += $value; } echo $res;
Correcting teacher:查無此人Correction time:2019-05-21 09:09:34
Teacher's summary:完成的不錯。for和while是計算循環(huán),foreach是數(shù)組循環(huán)。繼續(xù)加油。