PHP code example of alcea / cif

1. Go to this page and download the library: Download alcea/cif 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/ */

    

alcea / cif example snippets


composer 


# ea\cif\Cif;

$cifToBeValidated = '159'; // without prefix digit (RO|R)
$cif = new Cif($cifToBeValidated);
echo "CIF {$cifToBeValidated} is " . ( $cif->isValid() ? 'valid' : 'invalid' ) . PHP_EOL;

// or

echo "CIF {$cifToBeValidated} is " . ( Cif::validate($cifToBeValidated) ? 'valid' : 'invalid' ) . PHP_EOL;