mirror of
https://github.com/danielstjules/Stringy.git
synced 2025-08-12 16:24:00 +02:00
Add why section
This commit is contained in:
21
README.md
21
README.md
@@ -10,6 +10,7 @@ s('string')->toTitleCase()->ensureRight('y') == 'Stringy'
|
|||||||
|
|
||||||
[](https://travis-ci.org/danielstjules/Stringy)
|
[](https://travis-ci.org/danielstjules/Stringy)
|
||||||
|
|
||||||
|
* [Why?](#why)
|
||||||
* [Installation](#installation)
|
* [Installation](#installation)
|
||||||
* [OO and Chaining](#oo-and-chaining)
|
* [OO and Chaining](#oo-and-chaining)
|
||||||
* [Implemented Interfaces](#implemented-interfaces)
|
* [Implemented Interfaces](#implemented-interfaces)
|
||||||
@@ -97,6 +98,26 @@ s('string')->toTitleCase()->ensureRight('y') == 'Stringy'
|
|||||||
* [Tests](#tests)
|
* [Tests](#tests)
|
||||||
* [License](#license)
|
* [License](#license)
|
||||||
|
|
||||||
|
## Why?
|
||||||
|
|
||||||
|
In part due to a lack of multibyte support (including UTF-8) across many of
|
||||||
|
PHP's standard string functions.
|
||||||
|
|
||||||
|
```php
|
||||||
|
// Standard library
|
||||||
|
strtoupper('fòôbàř'); // 'FòôBàř'
|
||||||
|
strlen('fòôbàř'); // 10
|
||||||
|
|
||||||
|
// Stringy
|
||||||
|
s('fòôbàř')->toUpperCase(); // 'FÒÔBÀŘ'
|
||||||
|
s('fòôbàř')->length(); // '6'
|
||||||
|
```
|
||||||
|
|
||||||
|
But also to offer an OO wrapper around the `mbstring` module's
|
||||||
|
multibyte-compatible functions. Handling some quirks, bugs, adding some
|
||||||
|
additional functionality, and hopefully making strings a little easier to work
|
||||||
|
with!
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
If you're using Composer to manage dependencies, you can include the following
|
If you're using Composer to manage dependencies, you can include the following
|
||||||
|
Reference in New Issue
Block a user