PHPackages                             urmaul/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. urmaul/url

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

urmaul/url
==========

Helper class to work with url strings.

v1.3.1(8y ago)02191MITPHPPHP &gt;=5.3

Since Jun 6Pushed 8y agoCompare

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

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

Url
===

[](#url)

Helper class to work with url strings.

[![Build Status](https://camo.githubusercontent.com/c777b3b3f9eac5cf2aae4afc162445bbb28017d81608040504775002085e57eb/68747470733a2f2f7472617669732d63692e6f72672f75726d61756c2f75726c2e737667)](https://travis-ci.org/urmaul/url)

Installing
----------

[](#installing)

`composer require urmaul/url dev-master`

Creating
--------

[](#creating)

```
use urmaul\url\Url;

$url = new Url('http://urmaul.com/');
// or
$url = Url::from('http://urmaul.com/');
```

Functions
---------

[](#functions)

- string **absolute($baseUrl)** - converts url from relative to absolute using base url.

```
echo Url::from('../html/')->absolute('http://urmaul.com/blog/tags/php/');
// http://urmaul.com/blog/tags/html/

echo Url::from('/blog/')->absolute('http://urmaul.com/blog/tags/php/');
// http://urmaul.com/blog/

echo Url::from('https://github.com/')->absolute('http://urmaul.com/blog/tags/php/');
// https://github.com/
```

- string **addParam($name, $value)** - adds get parameter to url.

```
echo Url::from('http://urmaul.com/')->addParam('foo', 'bar');
// http://urmaul.com/?foo=bar

echo Url::from('http://urmaul.com/?foo=bar')->addParam('spam', 'ham');
// http://urmaul.com/?foo=bar&spam=ham

echo Url::from('http://urmaul.com/?foo=bar')->addParam('foo', 'spam');
// http://urmaul.com/?foo=spam
```

- string **addParams($addParams)** - adds get parameters to url.

```
echo Url::from('http://urmaul.com/')->addParams(array('foo' => 'bar'));
// http://urmaul.com/?foo=bar

echo Url::from('http://urmaul.com/?foo=bar')->addParams(array('spam' => 'ham'));
// http://urmaul.com/?foo=bar&spam=ham

echo Url::from('http://urmaul.com/?foo=bar')->addParams(array('foo' => 'spam'));
// http://urmaul.com/?foo=spam
```

- string **removeParam($name, $value)** - removes get parameter from url.

```
echo Url::from('http://urmaul.com/?foo=bar')->removeParam('foo');
// http://urmaul.com/

echo Url::from('http://urmaul.com/?foo=bar&spam=ham')->removeParam('spam');
// http://urmaul.com/?spam=ham
```

- string **removeParams($removeParams)** - removes get parameters from url.

```
echo Url::from('http://urmaul.com/?foo=bar')->removeParams(array('foo', 'spam'));
// http://urmaul.com/

echo Url::from('http://urmaul.com/?foo=bar&spam=ham')->removeParams(array('foo', 'spam'));
// http://urmaul.com/

echo Url::from('http://urmaul.com/?foo=bar&foo=spam&ham=spam')->removeParams(array('foo', 'spam'));
// http://urmaul.com/?ham=spam
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity63

Established project with proven stability

 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 ~225 days

Recently: every ~272 days

Total

7

Last Release

3010d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/22364b943477de78bf89bb19b5708a93666e38b5f1ad954ded9c656b3c116cb8?d=identicon)[urmaul](/maintainers/urmaul)

---

Top Contributors

[![urmaul](https://avatars.githubusercontent.com/u/1838544?v=4)](https://github.com/urmaul "urmaul (2 commits)")

---

Tags

urlstring

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k394.3M1.5k](/packages/nette-utils)[spatie/url

Parse, build and manipulate URL's

73914.3M97](/packages/spatie-url)[league/uri-components

URI components manipulation library

31932.3M67](/packages/league-uri-components)[sabre/uri

Functions for making sense out of URIs.

29335.2M40](/packages/sabre-uri)[spomky-labs/base64url

Base 64 URL Safe Encoding/Decoding PHP Library

15439.5M49](/packages/spomky-labs-base64url)[opis/string

Multibyte strings as objects

7420.9M7](/packages/opis-string)

PHPackages © 2026

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