PHPackages                             martyn911/domain-parser - 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. martyn911/domain-parser

ActiveLibrary

martyn911/domain-parser
=======================

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

v2.0.9(8y ago)16231Apache-2.0PHPPHP &gt;=5.6.0

Since Apr 11Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Martyn911/DomainParser)[ Packagist](https://packagist.org/packages/martyn911/domain-parser)[ Docs](https://github.com/3name/DomainParser/)[ RSS](/packages/martyn911-domain-parser/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (1)DependenciesVersions (6)Used By (1)

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

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~261 days

Total

5

Last Release

3005d ago

### Community

Maintainers

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

---

Top Contributors

[![maxzvonkov](https://avatars.githubusercontent.com/u/48809402?v=4)](https://github.com/maxzvonkov "maxzvonkov (5 commits)")[![koroban](https://avatars.githubusercontent.com/u/148569?v=4)](https://github.com/koroban "koroban (4 commits)")[![AllenJB](https://avatars.githubusercontent.com/u/5645829?v=4)](https://github.com/AllenJB "AllenJB (3 commits)")[![3name](https://avatars.githubusercontent.com/u/5710161?v=4)](https://github.com/3name "3name (2 commits)")[![adduc](https://avatars.githubusercontent.com/u/44527?v=4)](https://github.com/adduc "adduc (1 commits)")[![Martyn911](https://avatars.githubusercontent.com/u/9728008?v=4)](https://github.com/Martyn911 "Martyn911 (1 commits)")

---

Tags

phpdomaindomainparser

### Embed Badge

![Health badge](/badges/martyn911-domain-parser/health.svg)

```
[![Health](https://phpackages.com/badges/martyn911-domain-parser/health.svg)](https://phpackages.com/packages/martyn911-domain-parser)
```

###  Alternatives

[rolfvreijdenberger/izzum-statemachine

A superior statemachine library php &gt;= 5.3. Integrates with your domain models perfectly.

7425.5k](/packages/rolfvreijdenberger-izzum-statemachine)

PHPackages © 2026

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