PHP: Format a string with masks
18, June 2019PHP-Mask, a simple way to format a string with masks...
If you are looking for a solution to format phone numbers, codes,... for a more readable way, the solution is PHP-Mask.
This library is an adaptation of ngx-mask.
Installation can be done by composer.
With it, you can format a string according predefined mask.
For instance, if you want to display the phone number 0102030405 like (010) 203-0405, the mask will be (000) 000-0000.
You can discover the library here.
See you for the next article !
Add a comment