PHP code example of ngekoding / php-hari-libur

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

    

ngekoding / php-hari-libur example snippets



Ngekoding\PhpHariLibur\Holiday;

$holiday = new Holiday('2020');

$date = '2020-01-01';
$isHoliday = $holiday->check($date);

echo $date.': '.$isHoliday; // Output: 2020-01-01: true

{
  "status": TRUE,
  "result": {
    "date": "2020-01-01",
    "description": "Hari libur awal tahun"
  }
}
bash
composer