No need to do that when you can calculate them...
function bankHols($yr)
{
// CALC PUBLIC HOLS FOR $yr
$hols = array();
$newyr = "$yr-01-01";
switch (date('w', strtotime($newyr))) {
case 6:
$newyr = "{$yr}-01-03";
break;
case 0:
$newyr = "{$yr}-01-02";
break;
}
$hols['New Year'] = $newyr;
$easter = easter_date($yr);
$hols['Easter'] = array(date('Y-m-d', strtotime('-2 days', $easter)),
date('Y-m-d', strtotime('+1 days', $easter)));
$mayday = (new DateTime("first monday of may $yr"))->format('Y-m-d');
$hols['May Day'] = $mayday;
$sbank = (new DateTime("last monday of may $yr"))->format('Y-m-d');
$hols['Spring Bank'] = $sbank;
$abank = (new DateTime("last monday of august $yr"))->format('Y-m-d');
$hols['August Bank'] = $abank;
$x1 = "$yr-12-25";
$x2 = "$yr-12-26";
switch (date('w', strtotime($x1))) {
case 5:
$x2 = "$yr-12-28";
break;
case 6:
$x1 = "$yr-12-27";
$x2 = "$yr-12-28";
break;
case 0:
$x1 = "$yr-12-26";
$x2 = "$yr-12-27";
break;
}
$hols['Christmas'] = array($x1,$x2);
return $hols;
}
$holidays = bankHols(2021);