📞 Spanish phone number validation
Installation
// npmnpm i spain-phone // yarnyarn add spain-phone
Demo
https://spain-phone-demo.netlify.com
Usage
Note: Replace the x's with numbers
Check if it is a valid phone number
; ; //=> true
Check it is a mobile or fixed number
; ; //=> true; //=> true; //=> true ; //=> true; //=> true
State by code / number
; ; // => ['Cádiz', 'Ceuta']; // => ['Valencia']; // => ['Barcelona'] ; // => ['Cádiz', 'Ceuta']);; // => ['Valencia']);; // => ['Barcelona']);
Others
; // paid by who receive the call; // => true // paid 50/50 or at national rate; // => true // usually used in tv contest, data system lines and services; // => true; // => true; // => true; // => true; // => true // internet access; // => true; // => true // radio-searching; // => true
Reference
https://es.wikipedia.org/wiki/Anexo:Prefijos_telef%C3%B3nicos_de_Espa%C3%B1a
Related
- better-dni - The fastest Spanish DNI (NIE / NIF) validation