-1

I need some code for a PHP project. I need to correct mobile number formats that we receive incorrectly on occasion into our API. If the number starts with +270 then it needs to be replaced with 27 and still preserve the rest of the number

code-is-life
  • 175
  • 2
  • 16

1 Answers1

1
$phoneNumber = preg_replace("(^\+270)", "27", $phoneNumber);

Simple as that.

Lulceltech
  • 1,662
  • 11
  • 22