Download the PHP package spartz/text-formatter without Composer
On this page you can find all versions of the php package spartz/text-formatter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download spartz/text-formatter
More information about spartz/text-formatter
Files in spartz/text-formatter
Download spartz/text-formatter
More information about spartz/text-formatter
Files in spartz/text-formatter
Vendor spartz
Package text-formatter
Short Description A simple to use text formatter, primarily used for page/blog titles
License MIT
Package text-formatter
Short Description A simple to use text formatter, primarily used for page/blog titles
License MIT
Please rate this library. Is it a good library?
Informations about the package text-formatter
Title Text Formatter
A simple to use text formatter, primarily used for page/blog titles.
Install
Via Composer
"require": {
"spartz/text-formatter": "~1.0"
}
Usage
use Spartz\TextFormatter\TextFormatter;
$title = "this is a messy title. [can you fix it?]";
$title = TextFormatter::titleCase($title);
echo $title; // This is a Messy Title. [Can You Fix It?]
Formatting "Rules"
- First word in a sentence is capitalized
- Last word in a sentence is capitalized
- Words within brackets (or similar) are capitalized, similar to rules #1 & #2
- Words within the
$ignoredWords
array should not be capitalized as long as it doesn't conflict with rules #1-#3 - Words preceded by multiple special characters should be capitalized: $$$Money
- All dashed words should be capitalized: Super-Awesome-Post
- Ignore words that already include at least one uppercase letter. We'll assume that the author knows what they're doing: eBay, iPad, McCormick, etc
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email Chris Gmyr instead of using the issue tracker.
Credits
- Chris Gmyr
- All Contributors
License
The MIT License (MIT). Please see License File for more information.
All versions of text-formatter with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.4.0
ext-mbstring Version *
ext-mbstring Version *
The package spartz/text-formatter contains the following files
Loading the files please wait ....