PHP code example of melba-ch / swiss-holidays

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

    

melba-ch / swiss-holidays example snippets


use MelbaCH\SwissHolidays\SwissHolidays;

$date = new \DateTime("2018-4-1");
$holidays = SwissHolidays::isHoliday($date, ["VD", "SO", "BE"]);

use MelbaCH\SwissHolidays\SwissHolidays;

$holidays = SwissHolidays::getHolidays("2019", ["TG", "ZH", "AG"]);