This library validates Cedulas de Identidad (english: ID Cards) from Uruguay.
Just install this library and call the class over a variable. It will return if true or false depending on the validation.
Using Composer, run:
$ composer require elratauru/validate-ci
Manually:
Copy the folder validate-ci to your project folder (I recommend using a subfolder for libraries) and require the Validator.php file.
use ValidateCI\Validator;
//Create a new Validator.
$validator = new Validator();
$validation = $validator->validate('1.234.567-8');
You can check the tests/index.php for more information.
- Alfonso Carvallo - The answers you seek, lie within
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the license.md file for details
- Wikipedia, has a decent explanation of how the ID Card is validated.
- Picandocodigo for inspiration.