Skip to content
/ text Public

PHP class for formatting and editing text

Notifications You must be signed in to change notification settings

iRim/text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Text

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

?>

About

PHP class for formatting and editing text

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages