ketchums/php-case-converter
Composer 安装命令:
composer require ketchums/php-case-converter
包简介
README 文档
README
php-case-converter is a library which converts strings to other case types.
Requirements
- PHP >= 7.4
Installation
Installing with composer
composer require ketchums/php-case-converter
Issues
Bug reports and feature requests can be submitted on the Github Issue Tracker.
Contributing
See CONTRIBUTING.md for information.
Versioning
php-case-converter uses a MAJOR.MINOR.PATCH version number format.
Examples
Basic
use App\CaseDetector;
use App\CaseConverter;
$string = 'some.cool.string';
$detector = new CaseDetector();
$converter = new CaseConverter($string, $detector->detectType($string));
echo $converter->toPascalCase(); // someCoolString
echo $converter->toKebabCase(); // some-cool-string
Don't like magic methods?
echo $caseConvert->toCase('pascal'); // someCoolString
echo $caseConvert->toCase('kebab'); // some-cool-string
Let the package detect the type for you
use App\CaseDetector;
use App\CaseConverter;
$converter = new CaseConverter($string);
统计信息
- 总下载量: 5
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-04-17