PHPackages                             layershifter/tld-support - 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. layershifter/tld-support

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

layershifter/tld-support
========================

Support package for TLDDatabase and TLDExtract

1.1.1(9y ago)382.5M—9.9%75Apache-2.0PHPPHP &gt;=5.5

Since Jun 8Pushed 9y ago1 watchersCompare

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

READMEChangelog (5)Dependencies (5)Versions (6)Used By (5)

TLDSupport
==========

[](#tldsupport)

Support package for [TLDDatabase](https://github.com/layershifter/TLDDatabase) and [TLDExtract](https://github.com/layershifter/TLDExtract). This package provides helpers for work with arrays, IP addresses, strings and more.

[![Build Status](https://camo.githubusercontent.com/afc7c9e7ba1bf42ba578799efddcd0516a4bf1328d4a3c9d1258407ded68aa9a/68747470733a2f2f7472617669732d63692e6f72672f6c61796572736869667465722f544c44537570706f72742e737667)](https://travis-ci.org/layershifter/TLDSupport) [![Code Climate](https://camo.githubusercontent.com/1202a8dbd8f526224e7a2b7750d9775d4d5072de92e52684340c71ce97ce0942/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6c61796572736869667465722f544c44537570706f72742f6261646765732f6770612e737667)](https://codeclimate.com/github/layershifter/TLDSupport) [![Test Coverage](https://camo.githubusercontent.com/e95dcbdc47003d9c5d7f81038400b3f872b9bb6ef572791baec4cf7175bbed47/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f6c61796572736869667465722f544c44537570706f72742f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/layershifter/TLDSupport/coverage) [![PHP 7 ready](https://camo.githubusercontent.com/5037015723f81b89cf5bdb6003a8cded1de3b68f494fd83f41e4802c9ec9f563/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f6c61796572736869667465722f544c44537570706f72742f6d61737465722f62616467652e737667)](https://travis-ci.org/layershifter/TLDSupport%7D)

---

This package is compliant with [PSR-1](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-1-basic-coding-standard.md), [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md), [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md). If you notice compliance oversights, please send a patch via pull request.

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

[](#requirements)

The following versions of PHP are supported.

- PHP 5.5
- PHP 5.6
- PHP 7.0
- HHVM

Usage
-----

[](#usage)

### Arrays:

[](#arrays)

```
mixed Arr::first(array $haystack, null|callable $callback, mixed $default);
mixed Arr::last(array $haystack, null|callable $callback, mixed $default);
```

### IP addresses:

[](#ip-addresses)

```
bool IP::isValid(string $hostname);
```

### Strings:

[](#strings)

```
bool     Str::endsWith(string $haystack, string|array $needles);
int      Str::length(string $value);
string   Str::lower(string $value);
string   Str::substr(string $string, int $start, int|null $length = null);
bool     Str::startsWith(string $haystack, string|array $needles);
bool|int Str::strpos(string $haystack, string $needles, int $offset = 0);
bool|int Str::strrpos(string $haystack, string $needles, int $offset = 0);
```

### Mixed:

[](#mixed)

```
mixed Mixed::value(mixed $value);
```

Install
-------

[](#install)

Via Composer

```
$ composer require layershifter/tld-support
```

Testing
-------

[](#testing)

```
$ composer test
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) and [CONDUCT](CONDUCT.md) for details.

License
-------

[](#license)

This library is released under the Apache 2.0 license. Please see [License File](LICENSE) for more information.

###  Health Score

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community17

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~2 days

Total

5

Last Release

3621d ago

Major Versions

0.1.1 → 1.02016-06-15

### Community

Maintainers

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

---

Top Contributors

[![layershifter](https://avatars.githubusercontent.com/u/14183168?v=4)](https://github.com/layershifter "layershifter (9 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/layershifter-tld-support/health.svg)

```
[![Health](https://phpackages.com/badges/layershifter-tld-support/health.svg)](https://phpackages.com/packages/layershifter-tld-support)
```

###  Alternatives

[vlucas/phpdotenv

Loads environment variables from `.env` to `getenv()`, `$\_ENV` and `$\_SERVER` automagically.

13.5k602.4M5.4k](/packages/vlucas-phpdotenv)[symfony/filesystem

Provides basic utilities for the filesystem

4.6k669.1M3.2k](/packages/symfony-filesystem)[friendsofphp/php-cs-fixer

A tool to automatically fix PHP code style

13.5k234.7M20.6k](/packages/friendsofphp-php-cs-fixer)[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.0M191](/packages/danielstjules-stringy)[rubix/ml

A high-level machine learning and deep learning library for the PHP language.

2.2k1.4M28](/packages/rubix-ml)[voku/portable-utf8

Portable UTF-8 library - performance optimized (unicode) string functions for php.

52322.4M40](/packages/voku-portable-utf8)

PHPackages © 2026

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