PHP code example of fr3on / php-recur
1. Go to this page and download the library: Download fr3on/php-recur 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/ */
fr3on / php-recur example snippets
use Fr3on\Recur\Recur;
$occurrences = Recur::daily()
->starting(new DateTimeImmutable('2026-04-13'))
->count(10)
->take(10);
use Fr3on\Recur\Recur;
use Fr3on\Recur\Rule\Weekday;
// Second Monday of every month
$builder = Recur::monthly()
->on(Weekday::MO->nth(2))
->take(12);
$builder = Recur::fromRrule("FREQ=WEEKLY;BYDAY=MO,WE,FR;COUNT=10");
foreach ($builder->occurrences() as $date) {
echo $date->format('Y-m-d');
}
bash
composer analyse