Validating USA cell/mobile phone numbers with regex? [duplicate]

拈花ヽ惹草 提交于 2019-12-13 22:14:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!