irim / text
PHP class for formatting and editing text
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Type:yii2-component
Requires
- php: >=5.4.0
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2024-09-18 09:31:05 UTC
README
UA: PHP класс для форматування та редагування тексту
EN: PHP class for formatting and editing text
Встановлення / Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist irim/text "*"
or add
"irim/text": "*"
to the require section of your composer.json
file.
Використання / Usage
<? $text = "how use THIS fkn script"; $script = new Text('cp1251'); // change encoding, default UTF-8 $load = $script->text($text) // Uppercase first letter echo $load->ucFirst()->end(); //OR echo Text::ucFirstLetter($text); // RESULT: How use THIS fkn script // to Title echo $load->toTitle()->end(); // RESULT: How Use This Fkn Script // to Upper echo $load->toUpper()->end(); // RESULT: HOW USE THIS FKN SCRIPT // to Lower echo $load->toUpper()->end(); // RESULT: how use this fkn script // the letter "s" to the uppercase echo $load->change('s',Text::toUpper)->end(); // RESULT: how uSe THIS fkn Script //OR // the letter "S" to the lowercase echo $load->change('S',Text::toLower)->end(); // RESULT: how use THIs fkn script ?>