PHP code example of cancio-labs / cpf-value-object

1. Go to this page and download the library: Download cancio-labs/cpf-value-object 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 / cpf-value-object example snippets


use CancioLabs\ValueObject\Cpf\Cpf;

$cpf = new Cpf('170.317.330-90'); // or '17031733090'
echo $cpf; // outputs 17031733090
echo $cpf->getRaw(); // outputs 17031733090
echo $cpf->getFormatted(); // outputs 170.317.330-90