PHP code example of masterkey / valid-docs

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

    

masterkey / valid-docs example snippets



    Masterkey\ValidDocs\ValidDocs;

    // Validando um CPF
    if(ValidDocs::validaCPF('111.111.111-11')) {
        echo "O CPF informádo é inválido";
    }

    // Validando um CNPJ
    if(ValidDocs::validaCNPJ('11.111.111/1111-11')) {
        echo "O CNPJ informado é inválido";
    }

    // Valida um CNPJ
    if(ValidDocs::validaPIS('111.11111.11/1')) {
        echo "O PIS informado é inválido";
    }