zero-to-prod / validate-url
Validates a url
Fund package maintenance!
zero-to-prod
v71.0.0
2024-11-09 13:15 UTC
Requires
- php: >=7.1
Requires (Dev)
Suggests
- zero-to-prod/data-model: Type-safe DTOs
- zero-to-prod/data-model-factory: Factories for a DataModel.
- zero-to-prod/transformable: Transform a class into different types.
README
Validates a URL.
Installation
Install the package via Composer:
composer require zero-to-prod/validate-url
Usage
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'])