Skip to content

Releases: ferryhopper/php-string-formatter

Release list

v0.1.0

Choose a tag to compare

@vlahanas vlahanas released this 07 Aug 22:17

🚀 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 of search with replace.
  • remove:target — Removes all occurrences of target.
  • 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.