將數值除以 500 取整後再乘回 500,常用於金額對齊、區間分組等場景。
<?php $evalue = 1234; $father = intval(floor($evalue / 500)) * 500; echo $father; // 1000 ?>
floor()
intval()
round($evalue/500)*500
ceil()