hyperia / yii2-string-helpers
为您的 Yii2 应用提供字符串助手
1.0.4
2020-11-04 20:25 UTC
Requires
- yiisoft/yii2: *
Requires (Dev)
- phpunit/phpunit: ^5.7
- symfony/var-dumper: *
This package is not auto-updated.
Last update: 2024-09-20 02:47:15 UTC
README
Yii2 字符串助手扩展
安装
安装此扩展的首选方式是通过 composer.
运行以下命令之一
composer require hyperia/yii2-string-helpers:"^1.0"
或
"hyperia/yii2-string-helpers": "^1.0"
将以下内容添加到您的 composer.json 的 require 部分中。
可用方法
- contains
- isLonger
- isShorter
- length
- toLower
- toUpper
- firstCharToUpper
- removeAccent
使用方法
use hyperia\helpers\StringHelper; echo StringHelper::isLonger('This is test string', 12); // 1 echo StrinhHelper::removeAccent('Ħí ŧħə®ë, юßť å test!'); // Hi there, jusst a test! echo StringHelper::contains('is', 'This is test string'); // 1
测试
./vendor/bin/phpunit