Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

Javascript code to Detect All Network Number In Nigeria (MTN, Glo, Airtel & 9Mobile).

Javascript code to Detect All Network Numbers In Nigeria 
(MTN, Glo, Airtel & 9Mobile).

function detect_number(phone) {
  if(phone !=''){
    if(phone.length > 3){
        previx = phone.substring(0, 4);
        console.log(previx);
        if( (previx =='0803') ||
            (previx =='0703') || 
            (previx =='0903') || 
            (previx =='0806') || 
            (previx =='0706') || 
            (previx =='0813') || 
            (previx =='0810') || 
            (previx =='0814') || 
            (previx =='0816')
        ){
            return 'MTN';
        }else if( (previx =='0805') ||
            (previx =='0705') || 
            (previx =='0905') || 
            (previx =='0807') || 
            (previx =='0815') || 
            (previx =='0811') || 
            (previx =='0905') 
        ){
            return 'GLO';
        }else if( (previx =='0809') ||
            (previx =='0909') || 
            (previx =='0817') || 
            (previx =='0818') 
        ){
            return '9MOBILE';
        }else if( (previx =='0802') ||
            (previx =='0902') || 
            (previx =='0701') || 
            (previx =='0808') || 
            (previx =='0708') || 
            (previx =='0812') 
        ){
            return 'AIRTEL';
        }else{
            return 'UNKNOWN';
        }
    }
  }else{
            return 'UNKNOWN';
  }
}

IF YOU NEED HELP, BE FREE TO CHAT ME UP THROUGH 
https://api.whatsapp.com/send?phone=2349026752559
Comment

PREVIOUS NEXT
Code Example
Javascript :: js NumberFormat 
Javascript :: hash url owl carousel example 
Javascript :: loops javascript 
Javascript :: xor operator js 
Javascript :: async function javascript dec 
Javascript :: JavaScript alert massage prompt 
Javascript :: mongodb populate 
Javascript :: react update version 
Javascript :: array.findindex is not a function 
Javascript :: supertest formdata 
Javascript :: warning each child in a list should have a unique key prop does not disappear 
Javascript :: useWidthSize 
Javascript :: bcrypt create encrypted password 
Javascript :: array intersection javascript es6 
Javascript :: javascript unary plus and negation operators 
Javascript :: canvas draw rect dashed 
Javascript :: react testing library increase debug length 
Javascript :: How to write on a web page javascript 
Javascript :: mern heroku Error: ENOENT: no such file or directory 
Javascript :: hostlistner 
Javascript :: using dot prototype with constructor in javascript 
Javascript :: js hide element 
Javascript :: react js class component 
Javascript :: jvectormap color regions 
Javascript :: for each append to document 
Javascript :: change color in react 
Javascript :: check if alpine js is loaded 
Javascript :: javaScript setMonth() Method 
Javascript :: js retry function if error 
Javascript :: index of javascript 
ADD CONTENT
Topic
Content
Source link
Name
9+4 =