Detect The Carrier/Mobile Network Of A Phone Number With Javascript, PHP, Java, C++, Ruby, etc
Leonel Elimpe
by Leonel Elimpe
~1 min read

Tags

  • Javascript
  • PHP

For a long time I’ve struggled with this problem, determining the Mobile Network a given phone number belongs to. Today I found out Google’s libphonenumber library (or any of it’s third party ports for other languages) have this functionality built in.

Specifically, the PhoneNumberToCarrierMapper functionality. I am currently using this with the PHP port here.

While researching this today, I equally came across this document which describes the breakdown of phone numbers by Carrier in Cameroon (MTN, ORANGE, and NEXTTEL). You can equally check it out if you intend to write functionality for a more specific use case.