1. Go to this page and download the library: Download treehousetim/bank-holidays 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/ */
treehousetim / bank-holidays example snippets
abstract public function getAsArray() : array;
abstract public function getObservedAsArray() : array;
$year = 2021;
$bankHolidayCalc = new \treehousetim\bankHolidays\usa( $year );
$info = $bankHolidayCalc->getChristmasDayDetail();
if( $info['observed'] )
{
echo 'In ' . $year . ', Christmas Day is not a bank holiday';
}
else
{
echo 'In ' . $year . ', Christmas Day is a bank holiday and is observed on ' . $info['date'];
}