If you want to convert a date later than September 22nd 1806, you could use this function. It's a bit crude and due to the fact the original function terminates in the middle of 1806, it uses 1805 as it's 'terminus post quem'.
<?php
function extended_jdtofrench ($juliandate) {
if ($juliandate > 2380945) {
$gregorian_date = jdtogregorian ($juliandate);
$temp = explode ('/', $gregorian_date);
$year = $temp[2];
$juliandate = gregoriantojd ($temp[0], $temp[1], 1805);
$republican_date = jdtofrench ($juliandate);
$republican_date = explode ('/', $republican_date);
$diff = $year - 1805;
$republican_date[2] = $republican_date[2] + $diff;
} else {
$republican_date = jdtofrench ($juliandate);
}
return $republican_date;
}
?>