isAlphaNumber() public method

Checks if the number is a valid vanity (alpha) number such as 800 MICROSOFT. A valid vanity number will start with at least 3 digits and will have three or more alpha characters. This does not do region-specific checks - to work out if this number is actually valid for a region, it should be parsed and methods such as {@link #isPossibleNumberWithReason} and {@link #isValidNumber} should be used.
public isAlphaNumber ( string $number ) : boolean
$number string the number that needs to be checked
return boolean true if the number is a valid vanity number
コード例 #1
0
 public function testIsAlphaNumber()
 {
     $this->assertTrue($this->phoneUtil->isAlphaNumber("1800 six-flags"));
     $this->assertTrue($this->phoneUtil->isAlphaNumber("1800 six-flags ext. 1234"));
     $this->assertTrue($this->phoneUtil->isAlphaNumber("+800 six-flags"));
     $this->assertFalse($this->phoneUtil->isAlphaNumber("1800 123-1234"));
     $this->assertFalse($this->phoneUtil->isAlphaNumber("1800 123-1234 extension: 1234"));
     $this->assertFalse($this->phoneUtil->isAlphaNumber("+800 1234-1234"));
 }