PHP code example of wallacemaxters / masker

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

    

wallacemaxters / masker example snippets


use WallaceMaxters\Masker\Masker;

$masker = new Masker();

$masker->mask('31995451199', '(00) 00000-0000'); // '(31) 99545-1199'
// or 
$masker('31995451199', '(00) 00000-0000'); // '(31) 99545-1199'

$masker->mask('ABC12345', '[AAA]_(00000)'); // '[ABC]_(12345)'

$masker->unmask('[ABC]_(12345)', '[AAA]_(00000)'); // 'ABC12345'

$cpf_or_cnpj = ['000.000.000-00', '00.000.000/0000-00'];

$masker->dynamic('45522248327', $cpf_or_cnpj); // '455.222.483-27'

$masker->dynamic('68544172000160', $cpf_or_cnpj); // '68.544.172/0001-60'