3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $cpf = 12345678912; if(is_numeric($cpf) && strlen($cpf) == 11) { $block1 = substr($cpf, 0, 3); $block2 = substr($cpf, 3, 3); $block3 = substr($cpf, 6, 3); $block4 = substr($cpf, 9); echo "$block1.$block2.$block3-$block4"; }
based on 1d4J1
Output for 5.3.19 - 7.2.0
123.456.789-12