PHP code example of nacholibre / billingdates

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

    

nacholibre / billingdates example snippets



use BillingDates\Calculator;

$calculator = new Calculator;

$startBillingDate = \DateTime::createFromFormat($defaultFormat, '2019-01-15');
$stubCurrentDate = \DateTime::createFromFormat($defaultFormat, '2019-03-10');

$data = $calculator->calculateMonthlyCycle($startBillingDate, $stubCurrentDate);

echo $data['start']->format('Y-m-d') . PHP_EOL;
echo $data['end']->format('Y-m-d') . PHP_EOL;