PHP code example of chuano / spain-document-generator

1. Go to this page and download the library: Download chuano/spain-document-generator library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

chuano / spain-document-generator example snippets



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