cybercog/php-unicode 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

cybercog/php-unicode

最新稳定版本:1.0.0

Composer 安装命令:

composer require cybercog/php-unicode

包简介

PHP Unicode library

README 文档

README

Releases Build License

Introduction

Streamline Unicode strings and characters (code points) manipulations. Object oriented implementation.

Installation

Pull in the package through Composer.

composer require cybercog/php-unicode

Usage

Instantiate Unicode String

$string = \Cog\Unicode\UnicodeString::of('Hello');

UnicodeString object will contain a list of Unicode characters.

For example, the Unicode string "Hello" is represented by the code points:

  • U+0048 (H)
  • U+0065 (e)
  • U+006C (l)
  • U+006C (l)
  • U+006F (o)

Represent Unicode String

$string = \Cog\Unicode\UnicodeString::of('Hello');

echo strval($string); // (string) "Hello"

Instantiate Unicode Character

$character = \Cog\Unicode\Character::of('ÿ');

$character = \Cog\Unicode\Character::ofDecimal(255);

$character = \Cog\Unicode\Character::ofHexadecimal('U+00FF');

$character = \Cog\Unicode\Character::ofHtmlEntity('ÿ');

$character = \Cog\Unicode\Character::ofXmlEntity('ÿ');

Represent Unicode Character in any format

$character = \Cog\Unicode\Character::of('ÿ');

echo strval($character); // (string) "ÿ"

echo $character->toDecimal(); // (int) 255

echo $character->toHexadecimal(); // (string) "U+00FF"

echo $character->toHtmlEntity(); // (string) "ÿ"

echo $character->toXmlEntity(); // (string) "ÿ"

License

About CyberCog

CyberCog is a Social Unity of enthusiasts. Research the best solutions in product & software development is our passion.

CyberCog

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2023-10-14