Twine is a stand-alone PHP 7 package by Chris Kankiewicz for string manipulation and comparison with an expressive fluid syntax.
They provide several code examples showing the package in action:
- adding padding to the left/right
- starts with/contains/ends with
- converting the string to a hash
- basic string formatting
The package also makes use of a fluent interface, making it easier to stack multiple operations onto a string (like checking to see if a substring equals a value). You can find out more about the package on its GitHub repository.