承接 carry0987/tag 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

carry0987/tag

最新稳定版本:1.1.4

Composer 安装命令:

composer require carry0987/tag

包简介

PHP Tag Management Library: A Comprehensive Toolkit for Tag Handling

README 文档

README

Packgist
PHP Tag Management Library: A Comprehensive Toolkit for Tag Handling

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

  • 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

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

composer require carry0987/tag

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 file.

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.

统计信息

  • 总下载量: 34
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-01-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固