PHP code example of thewildhorse / croatian-holiday

1. Go to this page and download the library: Download thewildhorse/croatian-holiday 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/ */

    

thewildhorse / croatian-holiday example snippets


$holidays = CroatianHoliday::getAllHolidaysForYear(2016);
foreach($holidays as $name => $date) {
  echo $name . ": " . $date->format('d.m.Y.'); // Božić: 25.12.2016
}

$holidayName = CroatianHoliday::getHolidayNameById(HolidayEnumeration::Uskrs);
echo $holidayName; // Uskrs
$holidayName = CroatianHoliday::getHolidayNameById(HolidayEnumeration::Uskrs, 'en');
echo $holidayName; // Easter