I've been trying to validate phone numbers to the format 5555555555. I've successfully been able to strip the phone number of all special characters, but if a phone number is entered with +15555555555, the number still contains '1' at the beginning of the number. Is there anyway to remove both the +1 and special characters?
My current regex is preg_replace('/^1|\D/', "", +15555555555);
.
Any help would be appreciated!