PHPackages                             whackashoe/domainbase - 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. whackashoe/domainbase

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

whackashoe/domainbase
=====================

Get base domain from url

06PHP

Since Jan 28Pushed 11y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

[![Build Status](https://camo.githubusercontent.com/296b66600df21976a4db934730c5a8ab693be9ffada324ab6725c3556003c825/68747470733a2f2f7472617669732d63692e6f72672f776861636b6173686f652f646f6d61696e626173652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/whackashoe/domainbase.svg?branch=master)

domainbase
==========

[](#domainbase)

Get the base domain of a url in php.

Getting the actual domain from a url can suck, there are multiple edgecases and it isn't built into php.

With domainbase, just pass it a url like this:

```

$dbase = new DomainBase();
$dbase->basename("http://images.google.co.uk/somecrap?here=adasdasd");
//this will return "google"

```

easy!

Installation
============

[](#installation)

`require: "whackashoe/domainbase": "dev-master"`

License
=======

[](#license)

MIT license (for u lovely lawyery programmer types)

Pull requests appreciated; if you have any questions please open an issue, thanks.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

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

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/whackashoe-domainbase/health.svg)

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

###  Alternatives

[stoutlogic/acf-builder

An Advanced Custom Field Configuration Builder

8311.8M60](/packages/stoutlogic-acf-builder)[lambdish/phunctional

λ PHP functional library

3612.0M23](/packages/lambdish-phunctional)[spatie/nova-backup-tool

A Laravel Nova tool to backup your application.

361560.7k1](/packages/spatie-nova-backup-tool)[digital-creative/conditional-container

Provides an easy way to conditionally show and hide fields in your Nova resources.

116593.8k4](/packages/digital-creative-conditional-container)

PHPackages © 2026

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