2017 © Pedro Peláez
 

library rut-php

Rut library

image

tifon/rut-php

Rut library

  • Friday, July 17, 2015
  • by mnico
  • Repository
  • 3 Watchers
  • 1 Stars
  • 50 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Rut Library

This library contain two simples class to provide you helpers methods to work with rut., (*1)

Build Status, (*2)

Installation

Using Composer just add a dependency on tifon/rut-php to your project's composer.json file. Here is an example:, (*3)

{
    "require": {
        "tifon/rut-php": "1.0.*"
    }
}

Usage Util

Validate a Rut.

<?php
use Tifon\Rut\RutUtil;

RutUtil::validateRut('11.111.111-1');
// Or
RutUtil::validateRut(11111111, 1);

Generate random Rut.

<?php
use Tifon\Rut\RutUtil;

$randomRutWithFormatter = RutUtil::generateRut();
// Generate rut between 1000000 and 2000000 and separate the check digit.
list($rut, $dv) = RutUtil::generateRut(FALSE, 1000000, 2000000);

Formatting a Rut.

<?php
use Tifon\Rut\RutUtil;

$rut = RutUtil::formatterRut(111111111);
// 11.111.111-1

// Or
$rut = RutUtil::formatterRut(11111111, 1, FALSE);
// 11111111-1

Separate the check digit from the Rut.

<?php
use Tifon\Rut\RutUtil;

list($rut, $dv) = RutUtil::separateRut('11.111.111-1');

Usage Rut

<?php
use Tifon\Rut\Rut;

$rut = new Rut('11.111.111-1');
// Or
$rut = new Rut(11111111, 1);

echo $rut->getRut();
// 11111111
echo $rut->getDv();
// 1
echo $rut->getFormatter();
// 11.111.111-1
echo $rut->getRaw();
// 111111111
echo $rut->isValid();
// 1

The Versions

17/07 2015

dev-master

9999999-dev https://github.com/Tifon-/rut-php

Rut library

  Sources   Download

MIT

The Requires

  • php >=5.3

 

The Development Requires

by Nicolas Moncada

run rut chile

17/07 2015

1.0.0

1.0.0.0 https://github.com/Tifon-/rut-php

Rut library

  Sources   Download

MIT

The Requires

  • php >=5.3.2

 

The Development Requires

by Nicolas Moncada

run rut chile