phone number format

parent 57528a5c
Changing Phone number format
_________________________________
-->We need to change code in CLASS.FORMAT.PHP
$stripped= preg_replace("/[^0-9]/", "", $phone);
if(strlen($stripped) == 7)
return preg_replace("/([0-9]{3})([0-9]{4})/", "$1-$2",$stripped);
elseif(strlen($stripped) == 10)
return preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "($1) $2-$3",$stripped);
else
return $phone; */
__________________________________________________
-->Replace the above code with below code
__________________________________________________
$stripped= preg_replace("/[^0-9]/", "", $phone);
if(strlen($stripped) == 7)
return preg_replace("/([0-9]{7})/", "$1",$stripped);
elseif(strlen($stripped) == 10)
return preg_replace("/([0-9]{10})/", "$1",$stripped);
else
return $phone;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment