Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR 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
 
PREVIOUS NEXT
Tagged: #Javascript #code #Detect #All #Network #Number #In #Nigeria #Airtel
ADD COMMENT
Topic
Name
6+4 =