Normalizes a string of characters representing a phone number. This strips all characters which
are not diallable on a mobile phone keypad (including all non-ASCII digits).
public static normalizeDiallableCharsOnly ( string $number ) : string | ||
$number | string | a string of characters representing a phone number |
return | string | the normalized string version of the phone number |
public function testNormaliseStripNonDiallableCharacters() { $inputNumber = "03*4-56&+a#234"; $expectedOutput = "03*456+234"; $this->assertEquals($expectedOutput, $this->phoneUtil->normalizeDiallableCharsOnly($inputNumber), "Conversion did not correctly remove non-diallable characters"); }