From 812f227f11e9ea31959b3811c305a680a7f68402 Mon Sep 17 00:00:00 2001 From: "Daniel St. Jules" Date: Tue, 28 Jul 2015 23:28:23 -0700 Subject: [PATCH] Add why section --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/README.md b/README.md index a4a07dc..7cd7da2 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,7 @@ s('string')->toTitleCase()->ensureRight('y') == 'Stringy' [![Build Status](https://api.travis-ci.org/danielstjules/Stringy.svg?branch=master)](https://travis-ci.org/danielstjules/Stringy) +* [Why?](#why) * [Installation](#installation) * [OO and Chaining](#oo-and-chaining) * [Implemented Interfaces](#implemented-interfaces) @@ -97,6 +98,26 @@ s('string')->toTitleCase()->ensureRight('y') == 'Stringy' * [Tests](#tests) * [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 If you're using Composer to manage dependencies, you can include the following