PHP code example of topaz / holidays

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

    

topaz / holidays example snippets



LazHoliday\PublicHoliday;

try {
    $holiday = new PublicHoliday();
    var_dump($holiday->fetch('usa')->getDataForYear(2021));
} catch (Exception $e) {
    var_dump($e->getMessage());
}