问题
I need to write validation to check if a phone number is a valid USA cell / mobile phone number. I have found examples for landlines but not cell / mobile phones. Can anyone point me in the right direction with this?
回答1:
you can use Google's phone number handling library. Maybe better than regex. Here: https://github.com/giggsey/libphonenumber-for-php
来源:https://stackoverflow.com/questions/54417193/validating-usa-cell-mobile-phone-numbers-with-regex