Skip to content

Latest commit

 

History

History
51 lines (36 loc) · 2.27 KB

File metadata and controls

51 lines (36 loc) · 2.27 KB

Respect\StringFormatter

Build Status Code Coverage Latest Stable Version Total Downloads License

A powerful and flexible PHP library for formatting and transforming strings.

Installation

composer require respect/string-formatter

Usage

You can use individual formatters directly or chain multiple formatters together using the FormatterBuilder:

use Respect\StringFormatter\FormatterBuilder as f;

echo f::create()
    ->mask('7-12')
    ->pattern('#### #### #### ####')
    ->format('1234123412341234');
// Output: 1234 12** **** 1234

Formatters

Formatter Description
MaskFormatter Range-based string masking with Unicode support
PatternFormatter Pattern-based string filtering with placeholders
PlaceholderFormatter Template interpolation with placeholder replacement

Contributing

Please see our Contributing Guide for information on how to contribute to this project.

License

This project is licensed under the ISC License - see the LICENSE file for details.