<?php
function Hicri($GetDate){
// Aylar
$mname[1] = "Muharrem";
$mname[2] = "Safer";
$mname[3] = "Rebiü'l-Evvel";
$mname[4] = "Rebiü'l-Ahir";
$mname[5] = "Cemaziye'l-Evvel";
$mname[6] = "Cemaziye'l-Ahir";
$mname[7] = "Recep";
$mname[8] = "Şaban";
$mname[9] = "Ramazan";
$mname[10] = "Sevval";
$mname[11] = "Zi'l-ka'de";
$mname[12] = "Zi'l-Hicce";
$TDays=round(strtotime($GetDate)/(60*60*24));
$HYear=round($TDays/354.37419);
$Remain=$TDays-($HYear*354.37419);
$HMonths=round($Remain/29.531182);
$HDays=$Remain-($HMonths*29.531182);
$HYear=$HYear+1389;
$HMonths=$HMonths+10;
$HDays=$HDays+23;
if ($HDays>29.531188 and round($HDays)!=30){
$HMonths=$HMonths+1;
$HDays=Round($HDays-29.531182);
}
else
{
$HDays=Round($HDays);
}
if($HMonths>12){
$HMonths=$HMonths-12;
$HYear=$HYear+1;
}
echo "$HDays $mname[$HMonths] $HYear";
}
$today = date("Y-m-d");
echo Hicri($today);
?>