Validates a URL.
Install Zerotoprod\ValidateUrl
via Composer:
composer require zero-to-prod/validate-url
This will add the package to your project’s dependencies and create an autoloader entry for it.
Returns true if the URL is valid.
If you would like to specify the URL protocols that should be considered valid, pass an array of protocols.
Zerotoprod\ValidateUrl\ValidateUrl::isUrl('https://www.example.com')
Zerotoprod\ValidateUrl\ValidateUrl::isUrl('https://www.example.com', ['https', 'udp'])
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
git checkout -b feature-branch
).git commit -m 'Add some feature'
).git push origin feature-branch
).