tafhyseni/stringify

A magical string helper buddy

dev-master 2021-03-14 11:36 UTC

This package is not auto-updated.

Last update: 2024-10-28 04:59:30 UTC


README

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!

System Requirements

  • PHP >= 7.2 (the latest stable version of PHP is highly recommended)

Installation

composer require tafhyseni/stringify

Usage

Stringify is a package made for human. Makes manipulation easier, simpler and elegant.

use \Tafhyseni\Stringify\Stringify;

Examples

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>');

Documentation

Please see DOCUMENTATION for all available methods on string/text/html manipulation.

Testing

./vendor/bin/pest

Changelog

Please see CHANGELOG for more information what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email tafhyseni@gmail.com instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.