1. Go to this page and download the library: Download holidayapi/holidayapi-php 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/ */
holidayapi / holidayapi-php example snippets
$key = 'Insert your API key here';
$holiday_api = new \HolidayAPI\Client(['key' => $key]);
try {
// Fetch supported countries and subdivisions
$countries = $holiday_api->countries();
// Fetch supported languages
$languages = $holiday_api->languages();
// Fetch holidays with minimum parameters
$holidays = $holiday_api->holidays([
'country' => 'US',
'year' => 2019,
]);
var_dump($countries, $languages, $holidays);
} catch (Exception $e) {
var_dump($e);
}