PHPackages                             louisheimel/domainparser - 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. louisheimel/domainparser

ActiveLibrary

louisheimel/domainparser
========================

A domain name parser to parse and to validate a domain name.

116.7kPHP

Since Jun 18Pushed 7y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Novutec Domain Parser
=====================

[](#novutec-domain-parser)

A domain name parser to parse and to validate a domain name.

At first it will parse a given string to split it by the hostname and top-level domain name. This will be done with a list from Mozilla and we also added some missing second-level domain names. Afterwards we will convert the domain name to it punycode and unicode notation. If an error occures by doing so, e.g. characters that are not allowed. It will kill these characters and set a flag to false. This flag is used for the validation.

Copyright (c) 2007 - 2013 Novutec Inc. () Licensed under the Apache License, Version 2.0 (the "License").

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

[](#installation)

Installing from source: `git clone git://github.com/novutec/DomainParser.git` or [download the latest release](https://github.com/novutec/DomainParser/zipball/master)

Move the source code to your preferred project folder.

Usage
-----

[](#usage)

- Include Parser.php

```
require_once 'DomainParser/Parser.php';

```

- Create Parser() object

```
$Parser = new Novutec\DomainParser\Parser();

```

- Call parse() method

```
$result = $Parser->parse($string);

```

- Please note, if the given string doesn't contain a domain name the default tld .com will be added to the query. You may change this by adding a tld to the parse method call.

```
$result = $Parser->parse($string, $yourPreferredDefaultTld);

```

- You may choose 5 different return types. the types are array, object, json, serialize and xml. By default it is object. If you want to change that call the format method before calling the parse method or provide to the constructer. If you are not using object and an error occurs, then exceptions will not be trapped within the response and thrown directy.

```
$Parser->setFormat('json');
$Parser = new Novutec\DomainParser\Parser('json');

```

3rd Party Libraries
-------------------

[](#3rd-party-libraries)

Thanks to developers of following used libraries:

- phlyLabs:
- mozilla:

ChangeLog
---------

[](#changelog)

See ChangeLog at

Issues
------

[](#issues)

Please report any issues via

LICENSE and COPYRIGHT
---------------------

[](#license-and-copyright)

Copyright (c) 2007 - 2013 Novutec Inc. ()

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 80% 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/4fac92f3d44a4eecd0129dd5f15b0e46fb6ee8ac485eeea26a2dc88b9ebe323e?d=identicon)[louisheimel](/maintainers/louisheimel)

---

Top Contributors

[![koroban](https://avatars.githubusercontent.com/u/148569?v=4)](https://github.com/koroban "koroban (4 commits)")[![adduc](https://avatars.githubusercontent.com/u/44527?v=4)](https://github.com/adduc "adduc (1 commits)")

### Embed Badge

![Health badge](/badges/louisheimel-domainparser/health.svg)

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

PHPackages © 2026

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