PHP code example of crazynds / interval-expression
1. Go to this page and download the library: Download crazynds/interval-expression 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/ */
crazynds / interval-expression example snippets
use Crazynds\IntervalExpression\Interval;
$interval = new Interval();
// Expression for every 1 week on monday, wednesday and friday
$expression = '1 weekly 1,3,5';
if($interval->validate($expression)){
//is valid expression
$interval->parse($expression);
}
if($interval->parse($expression)){
//this way check if the expression is valid too and apply the expression in the interval
}