Format telefon numarası

0 Cevap php

I have to format a telephone number list, and I'd wish to extract and separate the prefix from the number for better viewing.
I have a list of all possible prefixes, but there is no regular pattern.
I mean, I could have these numbers:

00 - 12345 (short prefix)
0000 - 12345 (long prefix)

How can I manage that? Numbers are plain, without any special char (ie without / \ - . , ecc ecc).
Prefixes are like that:

030
031
0321
0322
...
...

Ben müşteri kasaba var çoğu zaman (gerekli değil) bu yüzden, usually i oradan önek alabilir, ancak bu yana town, kesin bir şey değil ve { [(2)]} bağlı olamazdı.

== EDIT ==
Prefix list is 231 entries long. Maybe I'll add somthing more, so take 300 as safe value
Moreover, prefixes come from a single country only (Italy)
I have to save plain numbers without any separator so users can search for it. Infact if they put separators they will never able to find again that.

More info
Prefix ALWAYS starts with a leading 0, its lenght ranges from 2-4

(: Ama daha ben bu şeyi incelemek, daha ben bunu çalışamaz düşünüyorum

0 Cevap