i’m newer related to Regexp on PHP…
I need to create an Regexp to filter Portuguese Mobile Phones, can anybody help me and explain how i do it? (To i understand it)
Rules:
The integer/string must have 9chars;
The first char must be a '9';
The second one can be '1,2,3,6' (Chars are separeted by commas);
The other chars must be in range of '0-9';
That should do it 😉
Explanation:
Use: If you want to check whether something is a valid phone number, use:
Notice the
^and$. These ensure there is only the phone number and nothing more.