You can use the module operator > :
$did = 0;
for($i=0;$i<100;$i++){
$did += $i % 10 == 9;
}
The expression $i % 10begins with 0, increases to 9 (10 - 1) and then "wraps" endlessly. $didincreases every time it is evaluated to 9, i.e. every 10 iterations.
, [0, 9] , $did ; , . 9 , 10-, 20- .. . 0 , 1, 11, 21 ..
, , ,
$did += ($i % 10 == 9);
if.