Skip to content

alganet/StringFormatter

 
 

Repository files navigation

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.

About

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

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • PHP 100.0%