PHP code example of phptcloud / isdayoff-sdk

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

    

phptcloud / isdayoff-sdk example snippets




use isDayOff\Client\IsDayOff;

$client = new IsDayOff();

$date = new DateTime('now');
$result = $client->date()->isDayOff($date);

if($result) {
    echo 'is day off.';
} else {
    echo 'working day.';
}

// Countries
isDayOff\Filters\UkraineFilter
isDayOff\Filters\RussianFilter
isDayOff\Filters\KazakhstanFilter
isDayOff\Filters\BelorusFilter
isDayOff\Filters\UnitedStatesFilter
isDayOff\Filters\UzbekistanFilter
isDayOff\Filters\TurkeyFilter

// Additional
isDayOff\Filters\CovidFilter
isDayOff\Filters\PreHolidayFilter

/**
 * New filter collection
 */
$filters = new FiltersCollection();
$filters->addOne(new UkraineFilter());

$client->date()->setFilters($filters);
$date = new DateTime('2019/01/01');

$result = $client->date()->getDataPerMonth($date);

print_r($result);