Jump to content

String function


sugan

Recommended Posts

You can split the number up and insert the new characters - this regex should do the trick

$phone = "9843067889";$phone = preg_replace("/([0-9]{3})([0-9]{3})([0-9]{4})/", "($1) $2-$3", $phone);

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...