π Initial release β v0.1.0
php-string-formatter is a simple and configurable string formatting pipeline for PHP.
It lets you apply formatting rules via a compact DSL, for example:
padLeft:10:0;replace:_:space;padAfterFirst:11:0
β Supported formatters
padLeft:length:charβ Pads the string on the left to a given length using a character.padRight:length:charβ Pads the string on the right to a given length using a character.replace:search:replaceβ Replaces all occurrences ofsearchwithreplace.remove:targetβ Removes all occurrences oftarget.padAfterFirst:length:charβ Pads the portion after the first character to the given length using a character.
π€ Special keyword
- Use
"space"to represent a space character (e.g.replace:_:spaceβ replaces_with a space)
See the README for full usage and examples.