I am a php novice and know there is a simple solution, however I can’t seem to find it. I am looking to perge the field of user entered symbols on return and apply formatting.
static function getFormatedNum($num){
if(empty($num)){}else{
$first= "(".substr($num, 0, 3).")";
$second= substr($num,3,3)."-";
$third=substr($num,6,4);
$num=$first.$second.$third;}
return $num;
Update: doing all the work in the same function
Output: