This method will throw a {@link NumberParseException} if the number is not considered to be a possible number. Note that validation of whether the number is actually a valid number for a particular region is not performed. This can be done separately with {@link #isValidnumber}.
public parse ( string $numberToParse, string $defaultRegion, |
||
$numberToParse | string | number that we are attempting to parse. This can contain formatting such as +, ( and -, as well as a phone number extension. |
$defaultRegion | string | region that we are expecting the number to be from. This is only used if the number being parsed is not written in international format. The country_code for the number in this case would be stored as that of the default region supplied. If the number is guaranteed to start with a '+' followed by the country calling code, then "ZZ" or null can be supplied. |
$phoneNumber | ||
$keepRawInput | boolean | |
Результат | a phone number proto buffer filled with the parsed number |