If you need to validate current numbers:
- starting with 9 would be mobile
- 7 is Nextel (another "type" of mobile)
- the rest would be fixed
If you need to treat history, it depends on the period you have stored, but in a generic way it would be:
- first digit > 5 is mobile
- first digit < 5 is fixed
- first digit = 5 can be fixed or mobile
This last scenario is due to the fact that at a certain moment, before the implantation of the ninth digit, Anatel released the use of numbers initiated by 5 to the mobile network, and there were already fixed started by 5 (most scenarios in SP)
Dude, I don’t understand your question. The 9th digit only exists for cell phone numbers.
– Jéf Bueno
@jbueno the doubt is whether I can identify the type of the phone by the first number, for example numbers started with 9 are mobile phones, numbers started with 3 are fixed, understood ?
– Douglas Neves
Not all cell phones start with 9, several operators start with 8.. You can’t guarantee this
– leofontes
Yes, you can do it.
– Jéf Bueno
You want to know how to do it in the code?
– Jéf Bueno
@leofontes, it was exactly this the doubt, whether I can or not, by the answers seems very contradictory.
– Douglas Neves
@Bacco, I changed the question, I think it’s clearer now =]
– Douglas Neves
@Douglasneves is giving a clean in the comments above. Well, for Brazil, as I said, if you start with 9 is cellular. This is standard now. If you have a region that has not yet migrated, it is only a matter of a few months.
– Bacco
@Bacco, Rigadão for the tip
– Douglas Neves
@jbueno, I edited the question I think was clearer now, I needed to identify if there is any pattern already defined to type the numbers through the first digit.
– Douglas Neves
@Bacco Last week was the last region. Now it’s all over the country.
– Jéf Bueno
@Douglasneves Like Bacco said. If you start with 9, it’s cellular. Of course that can change, but there’s another story
– Jéf Bueno
@leofontes With the new standard, all mobile numbers start with 9
– Jéf Bueno