PHP code example of vsilva472 / phpcpf
1. Go to this page and download the library: Download vsilva472/phpcpf 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/ */
vsilva472 / phpcpf example snippets
composer
{
" "vsilva472/phpcpf" : "*"
}
}
w cpf
$cpf = '123.456.789-00';
// Make the CPF validator
$validator = new \Vsilva472\phpCPF\CPF();
// @boolean
$is_cpf_valid = $cpf->validate( $_POST[ 'cpf' ] );
if ( $is_cpf_valid ) {
// do something with valid CPF
}
else {
// invalid CPF! Do something
}