zero-to-prod/validate-url

Validates a url

v71.0.0 2024-11-09 13:15 UTC

This package is auto-updated.

Last update: 2024-12-12 18:12:31 UTC


README

Repo GitHub Actions Workflow Status Packagist Downloads php Packagist Version License

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'])