I've got an input where the user is able to enter their website URL.
I can't use FILTER_VALIDATE_URL because that requires that the user types in http://
before their URL. Some users might just type www.website.com
or website.com
.
How can I validate a URL with the following rules:
- doesn't require the user to have
http://
,https://
, or any other form of this - doesn't require the user to have
www.
before their link (example: justwebsite.com
) - doesn't matter what domain extension is used
- allows links like
www.website.com/username
or anything alike to be used
How would this be done?