PHPackages                             zero-to-prod/validate-url - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Validation &amp; Sanitization](/categories/validation)
4. /
5. zero-to-prod/validate-url

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

zero-to-prod/validate-url
=========================

Validates a url

v71.1.0(8mo ago)116.6k↓28%2MITPHPPHP &gt;=7.1CI passing

Since Nov 9Pushed 8mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/validate-url)[ Packagist](https://packagist.org/packages/zero-to-prod/validate-url)[ Docs](https://github.com/zero-to-prod/validate-url)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-validate-url/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (7)Dependencies (2)Versions (8)Used By (2)

Zerotoprod\\ValidateUrl
=======================

[](#zerotoprodvalidateurl)

[![](art/logo.png)](art/logo.png)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/validate-url)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/14e3e980c41e23eba0779910d49d0c456d63eb5cdb93c62f276f61eb5faa83e8/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f76616c69646174652d75726c2f746573742e796d6c3f6c6162656c3d74657374)](https://github.com/zero-to-prod/validate-url/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/17ee8a70ab3e6993440166926a8fe909951a73b351107ed66b94fe14abfd7523/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f76616c69646174652d75726c2f6261636b77617264735f636f6d7061746962696c6974792e796d6c3f6c6162656c3d6261636b77617264735f636f6d7061746962696c697479)](https://github.com/zero-to-prod/validate-url/actions)[![Packagist Downloads](https://camo.githubusercontent.com/b0159bc474fd8161bfc7456ed8e370b647cf5d41e97f4c44c95128b51a77ed28/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f76616c69646174652d75726c3f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/validate-url/stats)[![php](https://camo.githubusercontent.com/7edbee7689780471c010bd98f3b85c433006ce73dab454db4d97050d9ef1f4bc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a65726f2d746f2d70726f642f76616c69646174652d75726c2e7376673f636f6c6f723d707572706c65)](https://packagist.org/packages/zero-to-prod/validate-url/stats)[![Packagist Version](https://camo.githubusercontent.com/51fbe264aafd781d8171f1808d9b3d88943c3e524d4af2116f447912a8cde8e3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f76616c69646174652d75726c3f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/validate-url)[![License](https://camo.githubusercontent.com/54a83b05915e425e81dd8a21f9cdfe4dd7eb12d7f87193405475d64f651d4b3f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f76616c69646174652d75726c3f636f6c6f723d70696e6b)](https://github.com/zero-to-prod/validate-url/blob/main/LICENSE.md)[![wakatime](https://camo.githubusercontent.com/82bf1f66b78182956e70cede00256eb3b1654d0c1f15527b46f805c22e20fc5f/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f76616c69646174652d75726c2e737667)](https://wakatime.com/badge/github/zero-to-prod/validate-url)[![Hits-of-Code](https://camo.githubusercontent.com/a8bcbce5acdf7e863553c60cb671be1d947e31cd3b727d991470e4a8eb6656c8/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f76616c69646174652d75726c3f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/validate-url/view?branch=main)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Usage](#usage)
- [Local Development](./LOCAL_DEVELOPMENT.md)
- [Contributing](#contributing)

Introduction
------------

[](#introduction)

Validates a URL.

Requirements
------------

[](#requirements)

- PHP 7.1 or higher.

Installation
------------

[](#installation)

Install `Zerotoprod\ValidateUrl` via [Composer](https://getcomposer.org/):

```
composer require zero-to-prod/validate-url
```

This will add the package to your project’s dependencies and create an autoloader entry for it.

Documentation Publishing
------------------------

[](#documentation-publishing)

You can publish this README to your local documentation directory.

This can be useful for providing documentation for AI agents.

This can be done using the included script:

```
# Publish to default location (./docs/zero-to-prod/validate-url)
vendor/bin/zero-to-prod-validate-url

# Publish to custom directory
vendor/bin/zero-to-prod-validate-url /path/to/your/docs
```

#### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
  "scripts": {
    "post-install-cmd": [
      "zero-to-prod-validate-url"
    ],
    "post-update-cmd": [
      "zero-to-prod-validate-url"
    ]
  }
}
```

Usage
-----

[](#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
------------

[](#contributing)

Contributions, issues, and feature requests are welcome! Feel free to check the [issues](https://github.com/zero-to-prod/validate-url/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.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance59

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~48 days

Recently: every ~57 days

Total

7

Last Release

261d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (19 commits)")

---

Tags

phpurlvalidationzero-to-prodvalidate url

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zero-to-prod-validate-url/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-validate-url/health.svg)](https://phpackages.com/packages/zero-to-prod-validate-url)
```

###  Alternatives

[zero-to-prod/data-model

Transforms Data into Type-Safe DTOs.

14226.2k32](/packages/zero-to-prod-data-model)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
