返回练习一下for......登陆

练习一下for循环

大红仓2019-03-11 19:21:05118

 $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循环

最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送
  • PHP中文网