jlinn / caseformat
一个受Google Guava的CaseFormat启发的PHP情况格式化工具。
1.0.0
2014-02-20 23:51 UTC
Requires
- php: >=5.3.2
Requires (Dev)
- phpunit/phpunit: 3.7.*
This package is not auto-updated.
Last update: 2024-09-14 14:40:04 UTC
README
一个受Google Guava的CaseFormat启发的PHP情况格式化工具。
使用Composer安装
假设composer.phar位于您的项目根目录,运行以下命令
php composer.phar require jlinn/caseformat:~1.0
用法
以下情况格式得到支持
从LOWER_UNDERSCORE
转换为UPPER_CAMEL
,例如,执行如下
use CaseFormat\CaseFormat; $converted = CaseFormat::LOWER_UNDERSCORE("test_string")->to(CaseFormat::UPPER_CAMEL);
在上面的例子中,$converted
的值将是"TestString"
。