PHPackages                             bickmista/spurl - 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. bickmista/spurl

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

bickmista/spurl
===============

A URL library that can validate, modify and split URL's. This library can split URL's into Subdomain, domain and TLD without choking when it comes to newer TLD's.

0.3.1(10y ago)13.6k1MITPHPPHP &gt;=5.4.0

Since Aug 12Pushed 10y ago2 watchersCompare

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

READMEChangelogDependencies (2)Versions (10)Used By (0)

Spurl [![Build Status](https://camo.githubusercontent.com/0348dad1daf9e0ece38608baf2312d3bd00cc86df69a2a06484494e590d85166/68747470733a2f2f7472617669732d63692e6f72672f6269636b6d697374612f737075726c2e737667)](https://travis-ci.org/bickmista/spurl) [![version](https://camo.githubusercontent.com/347745cd6131aa9bd03214ec7ed995a5db2c5880d26893495f0f69e6a182bc9c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6269636b6d697374612f737075726c2e737667)](https://packagist.org/packages/bickmista/spurl) [![Code Climate](https://camo.githubusercontent.com/9333140195ada0c618a7979e47b9de6c492f863d5067744f734873e5c493f5fd/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6269636b6d697374612f737075726c2f6261646765732f6770612e737667)](https://codeclimate.com/github/bickmista/spurl)
=======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#spurl---)

A URL manipulation library

Description
-----------

[](#description)

A PHP Library that can break down and build URLs into/from an array.

\##Implementations

### Current

[](#current)

- Breakdown URLs
- Build up URLs

### Planned

[](#planned)

- Replace segments before build
- Shuffle segments before build (e.g. swap host.domain with path.2)

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

[](#requirements)

- PHP 5.4+

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

[](#installation)

### Using Composer

[](#using-composer)

To install Spurl with Composer, just add the following to your composer.json file

```
{
    "require": {
        "bickmista/spurl": "0.*"
    }
}
```

or by running the following command:

```
composer require bickmista/spurl
```

Usage
-----

[](#usage)

### General

[](#general)

#### Shatter

[](#shatter)

To break down a URL into segments pass it into our shatter function.

```
$url = 'http://test.com/example/path?some=query#anchor';

$splitUrl = Spurl\Url::shatter($url);
```

The output from the shatter function in the example above would be

```
$splitUrl = [
  'protocol' => 'http',
  'host' => 'test.com',
  'path' => 'example/path',
  'query' => 'some=query',
  'anchor' => 'anchor'
];
```

You can also break down URLs further by passing `true` as an optional second parameter

```
$url = 'http://test.com/';

$splitUrl = Spurl\Url::shatter($url, true);
```

which would return

```
$splitUrl = [
  'protocol' => 'http',
  'host' => [
    'domain' => 'test',
    'suffix' => 'com'
  ]
];
```

---

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity54

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 79.6% 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 ~6 days

Total

7

Last Release

3897d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c8593a25c941597d72c12095eeb04a8e27a2c061c5e9c9904d56601f7fb2bcc3?d=identicon)[bickmista](/maintainers/bickmista)

---

Top Contributors

[![fatjoeluke](https://avatars.githubusercontent.com/u/23631646?v=4)](https://github.com/fatjoeluke "fatjoeluke (43 commits)")[![bickmista](https://avatars.githubusercontent.com/u/3404254?v=4)](https://github.com/bickmista "bickmista (11 commits)")

---

Tags

url

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/bickmista-spurl/health.svg)

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

###  Alternatives

[spatie/url

Parse, build and manipulate URL's

73914.3M97](/packages/spatie-url)[jbroadway/urlify

A fast PHP slug generator and transliteration library that converts non-ascii characters for use in URLs.

6737.4M62](/packages/jbroadway-urlify)[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)[misd/linkify

Converts URLs and email addresses in text into HTML links

1122.9M10](/packages/misd-linkify)

PHPackages © 2026

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