Skip to content

chuano/spain-document-generator

master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
src
 
 
 
 
 
 
 
 

Random Spain ID generator

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('-');

About

Spanish ID random generator

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages