ZF-2233: E.164 phone number standard as Zend_Phone and extending Zend_Locale
Zend_Phone is a new component which can handle E.164 calling numbers and display's them in a local format. Like the Zend_Date component, you can change the local format by using a different Zend_Locale. One example: you have an E.164 number like +49 211 123456789. with the locale 'de_DE' you would see this number as 0211 123456789, and someone with 'en_GB' would see it as 00 49 211 123456789.
As you can see, I have parted the phone number. This is important, because such a calling number has different parts. First of all, the '+' get's changed to the international prefix. In Germany it is '00', other countries have '0001' or something like that. The country calling number is everywhere the same. Next, we need to know, what the local prefix is. In Germany, it is the '0', like 0211 instead of 211. The Area code 211 is also important. Here it is possible to find out, if it is a mobile number or a fixed-line number. It is a lot easier to get the phone number type (mobile or fixed-line) within this component, because you have to split this number into parts or just leave an option where you can check the area code if it's a mobile or fixed-line number.
The formatting of telephone numbers, like the international prefix, the local prefix, spaces after two numbers etc. should be implemented into the Zend/Locale/Data XML files.
Besides the country calling numbers, Voice over IP providers often use the +0 calling number. Some telephone providers support those calling numbers, some don't, but to be compatible to nearly all kind of numbers, it should be added, too.
For those, who don't know the specifications of E.164 numbers I have added some links below. http://www.itu.int/publ/T-SP-E.164D-2006/en official paper which shows which country has which international number http://iso.org/iso/country_codes/… I checked the countries with this list http://en.wikipedia.org/wiki/… here you see all country calling codes http://en.wikipedia.org/wiki/E.164 E.164 specifications