Thanks to visit codestin.com
Credit goes to Github.com

Skip to content

nijens/range

Repository files navigation

Range

Latest version on Packagist Software License Build Status Coverage Status SensioLabsInsight StyleCI

Ruby range syntax parser for PHP.

Installation using Composer

Run the following command to add the package to the composer.json of your project:

$ composer require nijens/range

Usage

Parsing a range in Ruby syntax:

<?php

use Nijens\Range\Range;

$range = Range::parse('0..1');

echo $range->getFrom(); // Output: 0
echo $range->getTo(); // Output: 1

Converting a Range instance to Ruby range syntax:

<?php

use Nijens\Range\Range;

$range = new Range(0, 1, false);

echo $range; // Output: 0..1

About

Ruby range syntax parser for PHP.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages