Created
October 18, 2016 19:26
-
-
Save phsantiago/921e8870fc4deaaf1baad0bd6b4e7570 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$return = preg_replace( '/\b(\d{2})\D?(\d{3})\D?(\d{3})\D?(\d{4})\D?(\d{2})\b/' , '$1.$2.$3/$4-$5' , $cnpj ); | |
echo $return; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment