v1.5.0 2015-10-23 13:05 UTC


Rule-based string format.

Build Status Latest Stable Version Total Downloads Latest Unstable Version License


composer require urmaul/formatter dev-master


  • cut(delimiter) - returns string part between beginning and delimiter.
  • rcut(delimiter) - returns string part between delimiter and ending.
  • remove(substring) - removes substring. See str_replace.
  • replace(substring, replacement) - replaces substring with replacement. See str_replace.
  • removeMatch(pattern) - removes pattern. See preg_replace.
  • replaceMatch(pattern, replacement) - replaces pattern with replacement. See preg_replace.
  • map(array map) - replaces string with value from map.
  • between(leftBorder, rightBorder) - returns string part between first occurence of leftBorder and rightBorder.
  • trim([character_mask = " \t\n\r\0\x0B"]) - strips whitespace (or other characters) from the beginning and end of a string.
  • callback(callable) - processes string with callback.
  • grep(substring) - returns lines containing substring.
  • stripTags([allowable_tags]) - strips HTML and PHP tags from a string. See strip_tags.
  • iconv([encoding_from, encoding_to]) - converts character encoding. Defaults are "UTF-8" - "UTF-8//IGNORE" which remove invalid characters from utf-8 string.
  • stripWhitespaces(string) - returns string without unprintable characters.