Phone number
The BulkGate\Sms\Message\PhoneNumber class represents the phone number object.
The constructor accepts the required parameter phone number and optional country ISO code.
The second parameter is required if you enter a number in the national format. If you enter a phone number in the national format and don't enter the ISO 3166-1 alpha-2 code, BulkGate will fill the international prefix according to the country listed in your user account.
You can also change the phone number after creating an instance.
You can also set the ISO code.
In case of invalid ISO code, an exception BulkGate\Sms\Message\InvalidPhoneNumberException is called
Convert to JSON
The output is:
Other
Obtain a formatted phone number in a string
Obtaining an ISO code
It also supports fluent interface
Thank you for your feedback.