PHP code example of joaofigueira / portugal-holidays

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

    

joaofigueira / portugal-holidays example snippets


use Holidays\Holidays;
use Holidays\Clients\Json;
use Holidays\Handlers\File;

$client  = new Json;
$handler = new File;

$holidays = new Holidays($client, $handler);

$result = $holidays->get($years)->asArray();

use Holidays\Holidays;
use Holidays\Clients\Http;
use Holidays\Handlers\Xml;

$client  = new Http;
$handler = new Xml;

$holidays = new Holidays($client, $handler);

$result = $holidays->get($years)->asArray();