Mascarador de valores PHP

1.5.2 2023-05-12 16:40 UTC

This package is auto-updated.

Last update: 2024-06-12 18:50:51 UTC


README

68747470733a2f2f62616467656e2e6e65742f62616467652f506f776572656425323062792f4775737461766f204d65737365722f726564 68747470733a2f2f62616467656e2e6e65742f62616467652f446576656c6f706564253230666f722f5048502f626c7565 License: MIT

Goldbach Algorithms Mask (old repository) is a PHP library developed for Symfony for apply a mask to values.

Installation

Use the composer to install:

composer require messer/mask

Usage

It is possible to mask a string to one of the default settings or create a customization from the custom() method.

# add use Mask
use GoldbachAlgorithms\Mask\Mask;

# create a new mask
$mask = new Mask();

# returns '89566-410'
$mask->cep('89566410');

# returns '198.298.398-98'
$mask->cpf('19829839898');

# returns '03.635.359/0001-23'
$mask->cnpj('3635359000123');

# returns '12.345.678-9'
$mask->rg('123456789');

# returns '4321.****.****.1234'
$mask->creditCard('4321544534421234');

# returns '(11) 3227-3158'
$mask->phone('1132273158');

# returns '(21) 99943-2343'
$mask->phone('21999432343');

# returns '18/03/1690'
$mask->custom('18031690','##/##/####');

License

MIT

Copyright © 2023 Goldbach Algorithms