PHPackages                             mrferos/purl - 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. mrferos/purl

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

mrferos/purl
============

A PHP port of the furl library by gruns

06PHP

Since Nov 4Pushed 12y ago1 watchersCompare

[ Source](https://github.com/mrferos/purl)[ Packagist](https://packagist.org/packages/mrferos/purl)[ RSS](/packages/mrferos-purl/feed)WikiDiscussions master Synced 6d ago

READMEChangelogDependenciesVersions (1)Used By (0)

purl
====

[](#purl)

### A shameless port of the furl python library to PHP to make URL manipulation easy.

[](#a-shameless-port-of-the-furl-python-library-to-php-to-make-url-manipulation-easy)

#### The Query

[](#the-query)

Manipulating the url query is easy:

```
$url = \Purl\Purl::fromString('http://www.google.com/?one=1&two=2');
unset($url['one']);
$url['three'] = 'foo';
echo $url->toString();
// http://www.google.com/?two=2&three=foo
```

Alternatively you can do the same like so:

```
$url = \Purl\Purl::fromString('http://www.google.com/?one=1&two=2');
$url->getQuery()->add('three','foo')
                ->remove('one');
echo $url;
// http://www.google.com/?two=2&three=foo
```

Still one more way since the query has easy accessor methods in the Purl object:

```
$url = \Purl\Purl::fromString('http://www.google.com/?one=1&two=2');
$url->add('three', 'foo')
    ->remove('one');
echo $url;
// http://www.google.com/?two=2&three=foo
```

### The Path

[](#the-path)

You can add or remove from the path like so:

```
$url = \Purl\Purl::fromString('http://www.google.com/path/?foo=2');
$url->getPath()->add('second-part');
// 'http://www.google.com/path/second-part/?foo=2'
$url->getPath()->remove('path');
// http://www.google.com/second-part/?foo=2
```

### The Fragment

[](#the-fragment)

Fragments can be edited like so:

```
$url = \Purl\Purl::fromString('http://www.google.com/path/?foo=2#fragment/foo?arg=one');
$url->getFragment()->getQuery()->remove('arg');
// http://www.google.com/path/?foo=2#fragment/foo
$url->getFragment()->getPath()->remove('foo');
// http://www.google.com/path/?foo=2#fragment
```

[![Bitdeli Badge](https://camo.githubusercontent.com/b8e88957059c3a138944c915a7a40055224dc156860501702cb87365daea0258/68747470733a2f2f64327765637a68766c38323376302e636c6f756466726f6e742e6e65742f6d726665726f732f7075726c2f7472656e642e706e67)](https://bitdeli.com/free "Bitdeli Badge")

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/7af41bdd34c88e63ccca096fa4f461a24650f13161920be9a28de13068fbe0a1?d=identicon)[mrferos](/maintainers/mrferos)

---

Top Contributors

[![mrferos](https://avatars.githubusercontent.com/u/69551?v=4)](https://github.com/mrferos "mrferos (5 commits)")[![bitdeli-chef](https://avatars.githubusercontent.com/u/3092978?v=4)](https://github.com/bitdeli-chef "bitdeli-chef (1 commits)")

### Embed Badge

![Health badge](/badges/mrferos-purl/health.svg)

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

PHPackages © 2026

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