vvvtool / zh-converter
PHP中文繁简体字转换程序,为简体中文与繁体中文之间的转换提供了一种简单高效的解决方案。A PHP package for converting between simplified and traditional Chinese characters.
Requires
- php: >=7.0
Requires (Dev)
- phpunit/phpunit: ^7.1||>=9.0
This package is auto-updated.
Last update: 2025-05-13 11:02:19 UTC
README
Overview
The zh-converter
package provides a simple and efficient way to convert between simplified and traditional Chinese characters. It includes the ZhConverter
class with methods for both conversion types.
zh-converter
工具包为简体中文与繁体中文之间的字符转换提供了一种简单高效的解决方案。它包含 ZhConverter
类,支持两种转换方向的相关方法。
Installation
You can install the package via Composer. Run the following command in your terminal:
您可以通过 Composer 安装这个工具包。在终端中输入以下命令:
composer require vvvtool/zh-converter
Usage
To use the ZhConverter
class, include it in your PHP script:
要在您的 PHP 脚本中使用 ZhConverter
类,可按以下方式引入并操作:
require 'vendor/autoload.php'; use VVVTool\ZhConverter\ZhConverter; $converter = new ZhConverter(); // Convert to Traditional Chinese $traditional = $converter->toTraditional('简体字'); // Convert to Simplified Chinese $simplified = $converter->toSimplified('繁體字');
Contributing
We welcome contributions to the project! Please fork the repository and submit a pull request with your changes.
我们非常欢迎您为这个项目贡献力量!请 fork 我们的代码仓库,并提交包含您修改的 pull request。
Acknowledgements
This project's dictionaries are based on tongwen-dict. Thanks for their great work on maintaining the Chinese conversion dictionaries.
本项目的转换词典基于 tongwen-dict 项目。感谢他们在中文转换词典维护方面所做的杰出工作。
License
This project is licensed under the MIT License. See the LICENSE file for more details.
本项目遵循 MIT License 许可协议。详情请查看 LICENSE 文件。