PHP code example of joshtronic / php-holidayapi

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

    

joshtronic / php-holidayapi example snippets


$hapi = new HolidayAPI\v1('_YOUR_API_KEY_');

$parameters = array(
  // Required
  'country' => 'US',
  'year'    => 2016,
  // Optional
  // 'month'    => 7,
  // 'day'      => 4,
  // 'previous' => true,
  // 'upcoming' => true,
  // 'public'   => true,
  // 'pretty'   => true,
);

$response = $hapi->holidays($parameters);
shell
composer