- substr: documentation ( source)
- is_numeric: documentation ( source)
<?php
$phone = 19996096956;
if(is_numeric($phone) && strlen($phone) > 9 && strlen($phone) < 12) {
$ddd = substr($phone, 0, 2);
$block1 = substr($phone, 3, 5);
$block2 = substr($phone, 5, 9);
print($ddd);
print($block1);
print($block2);
}