chuano / spain-document-generator
Spanish CIF, NIF and NIE random generator.
Package info
github.com/chuano/spain-document-generator
pkg:composer/chuano/spain-document-generator
1.0.0
2020-03-29 17:36 UTC
Requires
- php: >=7.1
- ext-mbstring: *
Requires (Dev)
- phpunit/phpunit: ^9
This package is auto-updated.
Last update: 2026-03-01 00:13:58 UTC
README
Spanish CIF, NIF and NIE random generator.
Installation
composer require chuano/spain-document-generator
Usage
All parameters are optional. By default the separator will be empty and the type will be B.
<?php require_once 'vendor/autoload.php'; use Chuano\Util\SpainDocumentGenerator\SpainDocumentGenerator; $generator = new SpainDocumentGenerator(); // CIF type 'B' and control digit separator char '-' $cif = $generator->cif('B', '-'); // Control digit char '-' $nif = $generator->nif('-'); // Control digit char '-' $nie = $generator->nie('-');