how to mask phone number in php

Solutions on MaxInterview for how to mask phone number in php by the best coders in the world

showing results for - "how to mask phone number in php"
Elías
20 Jan 2019
1$data = '+11234567890';
2
3if(  preg_match( '/^\+\d(\d{3})(\d{3})(\d{4})$/', $data,  $matches ) )
4{
5    $result = $matches[1] . '-' .$matches[2] . '-' . $matches[3];
6    return $result;
7}