PHP code example of nojimage / holiday-jp

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

    

nojimage / holiday-jp example snippets


use Nojimage\HolidayJp\HolidayJp;

$holidayJp = new HolidayJp();

// Get list of holidays in 2024
$holidays = $holidayJp->getHolidays(2024);

// Get a list of holidays for the specified period
$holidays = $holidayJp->getHolidays(new DateTime('2024-01-01'), new DateTime('2024-12-31'));

// Determine if it is a holiday
$holidayJp->isHoliday('2024-01-01'); // true
$holidayJp->isHoliday('2024-01-02'); // false