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

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

salvobee/url-utilities
======================

A simple set of utilities to work with URLs

v0.0.1(4y ago)03MITPHP

Since Jun 15Pushed 4y ago1 watchersCompare

[ Source](https://github.com/salvobee/url-utilities)[ Packagist](https://packagist.org/packages/salvobee/url-utilities)[ RSS](/packages/salvobee-url-utilities/feed)WikiDiscussions main Synced today

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

URL Utilities
=============

[](#url-utilities)

A simple set of utilities to abstract in a more Object-Oriented fashion existing php url functions.

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

[](#installation)

```
composer require salvobee/url-utilities

```

Usage
-----

[](#usage)

Build an instance of the parser using a valid URL as constructor's argument.

```
use SalvoBee\UrlUtilities\Parser;

$url = new Parser('https://www.domain.com');
```

### Query string manipulation

[](#query-string-manipulation)

You can manipulate given url's query string parameters and getting a new url as return:

```
use SalvoBee\UrlUtilities\Parser;

$url = new Parser('https://www.domain.com?arg1=value1&arg2=value2');

$url->manipulateParameter('arg1','new_value');
// returns 'https://www.domain.com?arg1=new_value&arg2=value2'

$url->addParameter('arg3', 'value3');
// returns 'https://www.domain.com?arg1=value1&arg2=value2&arg3=value3'

$url->removeParameter('arg1');
// returns 'https://www.domain.com?arg2=value2'
```

### Multiple Values Fields

[](#multiple-values-fields)

⚠️Support to manipulate fields that holds multiple values is still in development and doesn't work as expected, feel free to submit a PR ⚠️

```
use SalvoBee\UrlUtilities\Parser;

$url = new Parser('https://www.domain.com?arg[]=value1&arg[]=value2');

$url->manipulateMultipleValue('arg','value1','new_value1');
// should return 'https://www.domain.com?arg[]=new_value1&arg[]=value2'

$url->addMultipleValue('arg', 'value3');
// should return 'https://www.domain.com?arg[]=value1&arg[]=value2&arg[]=value3'

$url->removeMultipleValue('arg','value2');
// should return 'https://www.domain.com?arg[]=value1'
```

### Standard Parser

[](#standard-parser)

URL components are parsed using standard php `parse_url()`, so if you need, you can access them using getters:

```
use SalvoBee\UrlUtilities\Parser;

$url = new Parser('https://john_doe:secret@www.domain.com:9999/path/to/resource?foo=bar&bar=foo#anchor');

$url->getScheme();         // returns "https"
$url->getHost();           // returns "www.domain.com"
$url->getPort();           // returns "9999"
$url->getUsername();       // returns "john_doe"
$url->getPassword();       // returns "secret"
$url->getPath();           // returns "/path/to/resource"
$url->getQueryString();    // returns "foo=bar&bar=foo"
$url->getFragment();       // returns "anchor"
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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

1788d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/2554c1ede6753423021a1061e2800c5d2052c296deba97cbaad17a0286f66aab?d=identicon)[salvobee](/maintainers/salvobee)

---

Top Contributors

[![salvobee](https://avatars.githubusercontent.com/u/19645064?v=4)](https://github.com/salvobee "salvobee (6 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[tga/simhash-php

SimHash similarities algorithm implementation for PHP 5.3

15243.5k1](/packages/tga-simhash-php)

PHPackages © 2026

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