# RRULE for PHP Lightweight and fast implementation of recurrence rules for PHP (RFC 5545), to easily work with recurring dates and events (such as in a calendar). This library is heavily based on [python-dateutil](https://labix.org/python-dateutil). [![Build Status](https://travis-ci.org/rlanvin/php-rrule.svg?branch=master)](https://travis-ci.org/rlanvin/php-rrule) [![Latest Stable Version](https://poser.pugx.org/rlanvin/php-rrule/v/stable)](https://packagist.org/packages/rlanvin/php-rrule) ## Basic example ```php use RRule\RRule; $rrule = new RRule([ 'FREQ' => 'MONTHLY', 'INTERVAL' => 1, 'DTSTART' => '2015-06-01', 'COUNT' => 6 ]); foreach ( $rrule as $occurrence ) { echo $occurrence->format('D d M Y'),"\n"; } // will output: // Mon 01 Jun 2015 // Wed 01 Jul 2015 // Sat 01 Aug 2015 // Tue 01 Sep 2015 // Thu 01 Oct 2015 // Sun 01 Nov 2015 echo $rrule->humanReadable(),"\n"; // monthly on the 1st of the month, starting from 01/06/2015, 6 times ``` Complete doc is available in [the wiki](https://github.com/rlanvin/php-rrule/wiki). ## Requirements - PHP >= 5.3 - [intl extension](http://php.net/manual/en/book.intl.php) is recommended for `humanReadable()` but not strictly required ## Installation The recommended way is to install the lib [through Composer](http://getcomposer.org/). Just add this to your `composer.json` file (change the version by the release you want, or use dev-master for the development version): ```JSON { "require": { "rlanvin/php-rrule": "1.*" } } ``` Then run `composer install` or `composer update`. Or just run `composer require "rlanvin/php-rrule" "1.*"` for it to be automatically installed and included in your `composer.json` Now you can use the autoloader, and you will have access to the library: ```php