A framework agnostic string manipulation package. Start ❤️ string manipulations again! Feeling paranoid about string manipulations? Hating regex? Hating string chunks, replacements, concatinations? This package is for you!
- PHP >= 7.2 (the latest stable version of PHP is highly recommended)
composer require tafhyseni/stringify
Stringify is a package made for human. Makes manipulation easier, simpler and elegant.
use \Tafhyseni\Stringify\Stringify;
Cutting a string after a certain word
Stringify::parse('Cut this string from here...')->removeAfter('from')->get();
Removing x-number of last characters
Stringify::parse('Remove3ofmylastcharacters')->removeLastChars(3)->get();
Removing HTML from a string/text expect a certain tag
$htmlInput = "<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>";
Stringify::parse('<p>Test paragraph.</p><!-- Comment --> <a href="#fragment">Other text</a>')->removeHtmlExpect('<a>');
Please see DOCUMENTATION for all available methods on string/text/html manipulation.
./vendor/bin/pest
Please see CHANGELOG for more information what has changed recently.
Please see CONTRIBUTING for details.
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
The MIT License (MIT). Please see License File for more information.