<?php
$cnt = 3;
3 % 3 余りは0
2 % 3 余りは2
1 % 3 余りは1
0 % 3 余りは0
$nocori = $cnt - (1 % 3);
//残りは2となる
?>
4 % 4 余りは0
3 % 4 余りは3
2 % 4 余りは2
1 % 4 余りは1
0 % 4 余りは0
More than 3 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme