PHP code example of fyre / period

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

    

fyre / period example snippets


use Fyre\Period\Period;

$period = new Period($start, $end, $granularity, $excludeBoundaries);

foreach ($period AS $date) { }

$contains = $period->contains($other);

$diffSymmetric = $period->diffSymmetric($other);

$end = $period->end();

$endEquals = $period->endEquals($date);

$endsAfter = $period->endsAfter($date);

$endsAfterOrEquals = $period->endsAfterOrEquals($date);

$endsBefore = $period->endsBefore($date);

$endsBeforeOrEquals = $period->endsBeforeOrEquals($date);

$equals = $period->equals($other);

$gap = $period->gap($other);

$granularity = $period->granularity();

$

$

$

$

$

$length = $period->length();

$overlap = $period->overlap($other);

$overlapAll = $period->overlapAll(...$others);

$overlapAny = $period->overlapAny(...$others);

$overlapsWith = $period->overlapsWith($other);

$renewed = $period->renew();

$start = $period->start();

$startEquals = $period->startEquals($date);

$startsAfter = $period->startsAfter($date);

$startsAfterOrEquals = $period->startsAfterOrEquals($date);

$startsBefore = $period->startsBefore($date);

$startsBeforeOrEquals = $period->startsBeforeOrEquals($date);

$subtract = $period->subtract($other);

$subtractAll = $period->subtractAll(...$others);

$touches = $period->touches($other);

use Fyre\Period\PeriodCollection;

$collection = new PeriodCollection(...$periods);

foreach ($collection AS $period) { }

$added = $collection->add(...$periods);

$boundaries = $collection->boundaries();

$gaps = $collection->gaps();

$intersect = $collection->intersect($period);

$overlapAll = $collection->overlapAll(...$others);

$sorted = $collection->sort();

$subtract = $collection->subtract($others);

$unique = $collection->unique();