PHPackages                             prinx/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. [Utility &amp; Helpers](/categories/utility)
4. /
5. prinx/url

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

prinx/url
=========

URL utilities for PHP

v1.0.0(4y ago)04MITPHP

Since Jul 9Pushed 4y ago1 watchersCompare

[ Source](https://github.com/prinx/url)[ Packagist](https://packagist.org/packages/prinx/url)[ RSS](/packages/prinx-url/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

URL
===

[](#url)

URL utilities for PHP

[![Build Status](https://github.com/prinx/url/actions/workflows/tests.yml/badge.svg)](https://github.com/prinx/url/actions/workflows/tests.yml)[![Latest Stable Version](https://camo.githubusercontent.com/a264b9306e71c7b0492ba1ee192bdac8a4318fdbd552e67ff8821930c1fbc95b/68747470733a2f2f706f7365722e707567782e6f72672f7072696e782f75726c2f762f737461626c652e737667)](https://packagist.org/packages/prinx/url)[![License](https://camo.githubusercontent.com/0e902bb6023e69ba28f22c404eedffc05f2fa33a2723ea6b35681374da1ee731/68747470733a2f2f706f7365722e707567782e6f72672f7072696e782f75726c2f6c6963656e73652e737667)](https://packagist.org/packages/prinx/url)

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

[](#installation)

```
composer require prinx/url
```

Usage
-----

[](#usage)

### Create an instance of the utility class

[](#create-an-instance-of-the-utility-class)

```
$url = new \Prinx\Url;
```

### Add query string to URL

[](#add-query-string-to-url)

```
$newUrl = $url->addQueryString('https://test.com', ['action' => 'test']); // https://test.com?action=test
$newUrl = $url->addQueryString('https://test.com?name=url', ['action' => 'test']); // https://test.com?name=url&action=test
```

### Get URL parts

[](#get-url-parts)

```
$urlParts = $url->getParts('https://test.com?name=url');

/*
[
  'scheme' => 'https'
  'host'   => 'test.com'
  'path'   => '/path/'
  'query'  => 'query=string&action=test&name=url'
]
*/
```

```
$urlParts = $url->getParts('https://user:password@test.com:85/path/?action=test&name=url#faq');

/*
[
  'scheme'   =>  'https'
  'host'     =>  'test.com'
  'port'     =>  85
  'user'     =>  'user'
  'pass'     =>  'password'
  'path'     =>  '/path/'
  'query'    =>  'action=test&name=url'
  'fragment' =>  'faq'
]
*/
```

### Get query string

[](#get-query-string)

```
$queryStrings = $url->getQueryStrings('https://test.com?name=url&action=test');

// ['name' => 'url', 'action' => 'test']
```

### Remove query string from URL

[](#remove-query-string-from-url)

```
$newUrl = $url->removeQueryString('https://test.com?name=url&action=test', 'name');

// https://test.com?action=test
```

```
$newUrl = $url->removeQueryString('https://test.com?name=url&action=test', ['name', 'action']);

// https://test.com
```

Contribute
----------

[](#contribute)

Star ⭐ the repo, fork it, fix a bug, add a new feature, write tests, correct documentation, and submit a pull request.

License
-------

[](#license)

[MIT](LICENSE)

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 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

Unknown

Total

1

Last Release

1774d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/896d24b4882562faf6f1c8c25ea90e515037f5811f251a11fd80b68db61fc458?d=identicon)[Prinx](/maintainers/Prinx)

---

Top Contributors

[![prinx](https://avatars.githubusercontent.com/u/7337610?v=4)](https://github.com/prinx "prinx (3 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/prinx-url/health.svg)

```
[![Health](https://phpackages.com/badges/prinx-url/health.svg)](https://phpackages.com/packages/prinx-url)
```

PHPackages © 2026

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