Download the PHP package urmaul/formatter without Composer
On this page you can find all versions of the php package urmaul/formatter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download urmaul/formatter
More information about urmaul/formatter
Files in urmaul/formatter
Download urmaul/formatter
More information about urmaul/formatter
Files in urmaul/formatter
Vendor urmaul
Package formatter
Short Description Rule-based string format.
License MIT
Homepage https://github.com/urmaul/formatter
Package formatter
Short Description Rule-based string format.
License MIT
Homepage https://github.com/urmaul/formatter
Please rate this library. Is it a good library?
Informations about the package formatter
Formatter
Rule-based string formatters. Made for polishing parsed data.
Installing
composer require urmaul/formatter dev-master
Using
$values = ['foo' => ' bar ', 'spam' => 'ham | foo | bar'];
$formatter = new Formatter([
['foo', 'trim'],
['spam', 'cut', ' | '],
]);
$values = $formatter->format($values);
// $values = ['foo' => 'bar', 'spam' => 'ham'];
Actions
- 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.
All versions of formatter with dependencies
PHP Build Version
Package Version
Requires
php Version
>=5.3
The package urmaul/formatter contains the following files
Loading the files please wait ...