1. Go to this page and download the library: Download remls/hijri-date library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
remls / hijri-date example snippets
use Carbon\Carbon;
new HijriDate(); // 1st Muharram 1000
new HijriDate(1443, 9, 1); // 1st Ramadan 1443
HijriDate::parse('1443-09-01'); // 1st Ramadan 1443
// From Gregorian
HijriDate::createFromGregorian(); // Today's date
today_hijri(); // Today's date
HijriDate::createFromGregorian('1991-12-01'); // 20th Jumada al-Ula 1412
$input = Carbon::parse('2002-03-04');
HijriDate::createFromGregorian($input); // 12th Dhul-Hijja 1422
// Gregorian to Hijri
HijriDate::createFromGregorian('1991-12-01'); // returns HijriDate
// Hijri to Gregorian
$date = new HijriDate(1443, 9, 1);
$date->getGregorianDate(); // returns Carbon