maskBrCnpj

This method applies the Brazilian CNPJ (company registration number) mask to the string.

Usage

$string = '11222333444455';
$string = SM::maskBrCnpj($string);
// or
$string = SM::make($string)
    ->maskBrCnpj();
echo $string; // 11.222.333/4444-55

With the alphanumeric version of 2026

$string = 'CAA3K5CZ000110';
$string = SM::maskBrCnpj($string);
// or
$string = SM::make($string)
    ->maskBrCnpj();
echo $string; // CA.A3K.5CZ/0001-10

This site uses Just the Docs, a documentation theme for Jekyll.