PHP code example of cancio-labs / cnpj-validation-function

1. Go to this page and download the library: Download cancio-labs/cnpj-validation-function 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/ */

    

cancio-labs / cnpj-validation-function example snippets


use function CancioLabs\Cnpj\Functions\assert_cnpj;

// These 2 example will execute normally
assert_cnpj('27.187.233/0001-00');
assert_cnpj('27187233000100');

// These 3 examples throw InvalidArgumentException
assert_cnpj('')
assert_cnpj('foo')
assert_cnpj('27187233000111')