zero-to-prod/validate-url

Validates a url

v71.0.2 2025-01-13 01:40 UTC

This package is auto-updated.

Last update: 2025-01-23 14:16:36 UTC


README

Repo GitHub Actions Workflow Status Packagist Downloads php Packagist Version License wakatime Hits-of-Code

Contents

Introduction

Validates a URL.

Requirements

  • PHP 7.1 or higher.

Installation

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.

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

Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.

  1. Fork the repository.
  2. Create a new branch (git checkout -b feature-branch).
  3. Commit changes (git commit -m 'Add some feature').
  4. Push to the branch (git push origin feature-branch).
  5. Create a new Pull Request.