- round: documentation ( source)
<?php
function getLunationNumber($m, $d, $y)
{
$offset = 1;
$synodicMonth = 29.530588861;
$lunationBase = 2423436.40347;
return round(((gregoriantojd($m, $d, $y) - $lunationBase ) / $synodicMonth )) + $offset;
}
echo getLunationNumber(1, 17, 1923).PHP_EOL; // 1
echo getLunationNumber(10, 25, 2003).PHP_EOL; // 1000