PHPackages                             carry0987/tag - 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. carry0987/tag

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

carry0987/tag
=============

PHP Tag Management Library: A Comprehensive Toolkit for Tag Handling

1.1.4(2y ago)134MITPHPPHP &gt;=7.2

Since Jan 19Pushed 2y ago1 watchersCompare

[ Source](https://github.com/carry0987/PHP-Tag)[ Packagist](https://packagist.org/packages/carry0987/tag)[ RSS](/packages/carry0987-tag/feed)WikiDiscussions master Synced today

READMEChangelog (7)DependenciesVersions (8)Used By (0)

PHP-Tag
=======

[](#php-tag)

[![Packgist](https://camo.githubusercontent.com/77d21355bfcd2380011a764bdcb9b70bc7c20cabf097948b0ed074580f07298c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6361727279303938372f7461672e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/carry0987/tag)
PHP Tag Management Library: A Comprehensive Toolkit for Tag Handling

Introduction
------------

[](#introduction)

PHP-Tag is a dynamic and robust library designed for developers who need to manage and manipulate tags within their PHP applications. Whether you're working on content management systems, music libraries, photo galleries, or any platform that utilizes tagging, this library provides an extensive suite of functionalities to streamline tag management.

Features
--------

[](#features)

- **String Tag Conversion**: Convert a comma-separated string of tags into an array and vice versa.
- **Tag Classification**: Group tags based on a custom pattern and distinguish between classified and unclassified tags.
- **Tag ID Management**: Merge, slice, check, and remove tag IDs with ease, supporting both single-dimensional and multi-dimensional arrays.
- **Normalization**: Sanitize and normalize tag names by replacing special characters, converting to lowercase, and trimming excess whitespace.
- **Regular Expression Patterns**: Set and use custom regular expression patterns for validating tag formats and classifications.
- **Exception Handling**: Built-in exception handling for robust and error-free tag manipulation.

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

[](#installation)

To install PHP-Tag, run the following command using Composer:

```
composer require carry0987/tag
```

Usage
-----

[](#usage)

Below is a quick example of how to use the PHP-Tag library:

```
require 'vendor/autoload.php';

use carry0987\Tag\Tag;

$tag = new Tag();

// Set and get string tags
$tag->setString('php,library,tag');
echo 'String Tags: ', $tag->getString(), PHP_EOL;

// Convert string tags to array
print_r($tag->getList());

// Classify tags and differentiate into groups
$tag->classifyTagGroup();
print_r($tag->getClassified());
print_r($tag->getUnclassified());

// Normalize a tag name for consistent formatting
echo Tag::clearTagName('  Normalize: This_Tag!  '), PHP_EOL;

// Merge and manipulate tag IDs
$tagsArray = [['id' => 1, 'name' => 'php'], ['id' => 2, 'name' => 'library']];
$mergedTagIds = Tag::mergeTagID($tagsArray, 'id');
echo 'Merged Tag IDs: ', $mergedTagIds, PHP_EOL;
```

For a more thorough understanding of PHP-Tag library functionalities, please refer to the **[example.php](./example/index.php)** file.

Contribution
------------

[](#contribution)

Contributions are welcome! Feel free to issue pull requests or submit issues if you'd like to improve the PHP-Tag library or add new features.

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

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.

###  Release Activity

Cadence

Every ~11 days

Recently: every ~0 days

Total

7

Last Release

831d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12984973?v=4)[carry0987](/maintainers/carry0987)[@carry0987](https://github.com/carry0987)

---

Top Contributors

[![carry0987](https://avatars.githubusercontent.com/u/12984973?v=4)](https://github.com/carry0987 "carry0987 (35 commits)")

### Embed Badge

![Health badge](/badges/carry0987-tag/health.svg)

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

###  Alternatives

[igorsgm/laravel-git-hooks

🪝• Efficiently manage Git hooks in Laravel projects. Enhance code quality, save time on reviews, and prevent bugs from entering your repository.

2939.2k1](/packages/igorsgm-laravel-git-hooks)

PHPackages © 2026

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