Download the PHP package innovaweb/chileanrut without Composer
On this page you can find all versions of the php package innovaweb/chileanrut. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download innovaweb/chileanrut
More information about innovaweb/chileanrut
Files in innovaweb/chileanrut
Package chileanrut
Short Description A Chilean Rut script to handle ruts
License MIT
Homepage https://github.com/innovawebcl/chilean-rut-php
Informations about the package chileanrut
ChileanRut
A Chilean Rut script to handle ruts. Take a look at contributing.md to see a to do list.
Installation
Via Composer
Usage
Format Function
Format the rut according to the assigned parameters, if withDotted is true it will always return with a hyphen, return string value
Params | Type | Description |
---|---|---|
$rut | string | rut with any of these formats 11.111.111-1, 11111111-1, 111111111 |
$withDotted | bool | return rut with dots format, default true |
$withHyphen | bool | return rut with hyphen format. default true |
Unformat Function
Clean the rut of spaces, dots and hyphens, return string value
Params | Type | Description |
---|---|---|
$rut | string | rut with any of these formats 11.111.111-1, 11111111-1, 111111111 |
Validate Function
Check if the code is valid with the validation algorithm, return boolean value
Params | Type | Description |
---|---|---|
$rut | string | rut with any of these formats 11.111.111-1, 11111111-1, 111111111 |
Calculate Dv Function
Calculates the check digit from a sequential rut number, return string value
Params | Type | Description |
---|---|---|
$number | int | only the number of rut as integer type |
Get Number Function
Extract the numerical part of the rut, can return with points according to the parameters, return string value
Params | Type | Description |
---|---|---|
$rut | string | rut with any of these formats 11.111.111-1, 11111111-1, 111111111 |
$withDotted | bool | return rut with dots format, default true |
Get Dv Function
Extract the check digit part of the rut, return string value
Params | Type | Description |
---|---|---|
$rut | string | rut with any of these formats 11.111.111-1, 11111111-1, 111111111 |
Example
`` Result
Change log
Please see the changelog for more information on what has changed recently.
Testing
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Alejandro Isla
- All Contributors
License
license. Please see the license file for more information.