PHP code example of wesleydeveloper / cpf-service

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

    

wesleydeveloper / cpf-service example snippets




esleydeveloper\CPFService\CPFService;

$twoCaptchaKey = ''; // API KEY https://2captcha.com
$cpfService = new CPFService($twoCaptchaKey);

$cpf = ''; // CPF para pesquisa (com ou sem pontuação)
$dataNasc = ''; // data de nascimento no formato br d/m/Y
try{
    $cpfService->check($cpf, $dataNasc);
}catch (\Exception $e){
    die($e->getMessage());
}
/*
 $cpfService->check($cpf, $dataNasc) retorna um beloano
 $cpfService->getResult() retorna um array
*/