jlinn/caseformat

一个受Google Guava的CaseFormat启发的PHP情况格式化工具。

1.0.0 2014-02-20 23:51 UTC

This package is not auto-updated.

Last update: 2024-09-14 14:40:04 UTC


README

Build Status

一个受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"