PHP code example of rapidwebltd / php-uk-bank-holidays

1. Go to this page and download the library: Download rapidwebltd/php-uk-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/ */

    

rapidwebltd / php-uk-bank-holidays example snippets


use RapidWeb\UkBankHolidays\Factories\UkBankHolidayFactory;

$holidays = UkBankHolidayFactory::getByDate(2017, 01, 2);

var_dump($holidays);

array(1) {
  [0]=>
  object(RapidWeb\UkBankHolidays\Objects\UkBankHoliday)#46 (4) {
    ["title"]=>
    string(16) "New Year’s Day"
    ["date"]=>
    string(10) "2017-01-02"
    ["notes"]=>
    string(14) "Substitute day"
  }
}

$englandWalesHolidays = UkBankHolidayFactory::getByDate(2017, 01, 2, 'england-and-wales');
$scotlandHolidays = UkBankHolidayFactory::getByDate(2017, 01, 2, 'scotland');
$northernIrelandHolidays = UkBankHolidayFactory::getByDate(2017, 01, 2, 'northern-ireland');

$allHolidays = array_merge($englandWalesHolidays, $scotlandHolidays, $northernIrelandHolidays);

$allHolidays = UkBankHolidayFactory::getAll();
$januaryHolidays = UkBankHolidayFactory::getByMonth(2017, 01);
$newYearsHolidays = UkBankHolidayFactory::getByDate(2017, 01, 2);