- var_dump: documentation ( source)
- round: documentation ( source)
<?php
$init = 5;
$str = round(6/3,2);
$iter = 3;
$total = $init;
for($i = 0; $i < $iter; $i++){
if($i === 0){
$res = $init - ($str * ($iter-1));
}else{
$res = $str;
}
$total = $total - $res;
var_dump($total);
}