Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
The missing PHP string library
PHP
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
src/Kemo/Strings
tests
.gitignore
README.md
composer.json
phpunit.xml

README.md

PHP string object class

The missing PHP string library

Author

This will make living with PHP strings easier by;

  • providing a simple chained API to string operations
  • not mixing up the needle haystack stuff
  • allowing you to extend and add your own methods in seconds
$text = 'Something to translate';
$text = strtr($text, $translation);
$text = htmlspecialchars($text);
$text = nl2br($text);
echo $text;

Str objects allow you this;

echo (new Str('Something to translate'))
    ->tr($translation)
    ->chars()
    ->nl2br();
Something went wrong with that request. Please try again.