cybercog/php-unicode
最新稳定版本:1.0.0
Composer 安装命令:
composer require cybercog/php-unicode
包简介
PHP Unicode library
关键字:
README 文档
README
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
PHP Unicodepackage is open-sourced software licensed under the MIT license by Anton Komarev.
About CyberCog
CyberCog is a Social Unity of enthusiasts. Research the best solutions in product & software development is our passion.
统计信息
- 总下载量: 8.85k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-10-14
