I'm looking for some way to validate telephone numbers in PHP, which may be entered in any of the various formats that exist. If it helps, I'm able to restrict the problem's domain to just U.S. phone numbers (or international numbers - one or the other, but not both).
I've tried looking for custom filters for filter_var()
, an equivalent to strtotime()
for phone numbers, or just plain vanilla parsing libraries, but haven't had much luck.
If needed, I can design a custom solution, but I prefer not to if one already exists, because A) mine will surely not be as robust, and B) I don't like reinventing the wheel.