phico/support
Composer 安装命令:
composer require phico/support
包简介
Support classes and functions for Phico
README 文档
README
Support classes and functions for Phico
Reference
str() Returns a new string instance
Convert json to string
// optionally pass boolean as_array as the second argument $json = str()->toJson($object, $as_array=false);
Decode json from string
// optionally pass any flag constants as the second argument $object = str()->fromJson($json, $flags = null);
Sanitise a string
$clean = str()->sanitise($input); // older alias str()->sanitize($input);
split a string on capitals
$str = str()->splitOnCaps('ACapitalisedString); // A Capitalised String
convert a string to camel case
$str = str()->toCamelCase('This is Camel case); // thisIsCamelCase
convert a string to kebab case
$str = str()->toKebabCase('This is Kebab case); // this-is-kebab-case
convert a string to pascal case
$str = str()->toPascalCase('This is pascal case); // This Is Pascal Case
convert a string to train case
$str = str()->toTrainCase('This is train case); // This-Is-Train-Case
Issues
If you discover any bugs or issues in behaviour or performance please create an issue, and if you are able a pull request with a fix.
Please make sure to update any tests as appropriate.
For major changes, please open an issue first to discuss what you would like to change.
License
统计信息
- 总下载量: 55
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 3
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2024-06-23