ludovicm67/strings
Composer 安装命令:
composer require ludovicm67/strings
包简介
Some useful functions for working with strings
README 文档
README
Some useful functions for working with strings
Installation
Just run the following command: composer require ludovicm67/strings
to add it to your PHP project!
Getting started
If you installed using composer, you can now create a file with the following code:
<?php // import here the composer autoloader require('./vendor/autoload.php'); // use the namespace for this library use ludovicm67\Strings\Strings;
clean strings
You can clean strings using the static method: Strings::clean("My string").
Example:
echo Strings::clean("test& ""~ "@éa/-âå€ÊÂøÊ±æ€ûýþ<b>bold</b>"); // will display: test& ""~ "@éa/-âå€ÊÂøÊ±æ€ûýþ<b>bold</b>
get a string from camelCase
Using Strings::fromCamelCase("myString") (will return: my-string).
Example:
echo Strings::fromCamelCase('testFromCamelCase'); // will display: test-from-camel-case
transform a string to camelCase
Using Strings::toCamelCase("my-string") (will return: myString).
Example:
echo Strings::toCamelCase('test-to-camel-case'); // will display: testToCamelCase
Want to contribute?
Just fork, commit and open a pull-request. Or just open an issue here: https://github.com/ludovicm67/php-strings/issues .
统计信息
- 总下载量: 380
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 2
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-27