PHP code example of free-elephants / altera

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

    

free-elephants / altera example snippets




use FreeElephants\AltEra\Builder\MonthAwareCalendarBuilder;

// Lets create calendar with 3 differance months
$builder = new MonthAwareCalendarBuilder("3 Months Based Calendar");

$builder->addMonth("first", 10)
		->addMonth("middle", 11)
		->addMonth("last", 12);

$calendar = $builder->getCalendar();
$calendar->getName(); // will return "3 Months Based Calendar"
$calendar->getNumberOfDaysInYear(); // will return "33" - sum of days in all months