This is a lightweight string manipulation library for PHP

v1.0.1 2021-11-16 05:37 UTC

This package is auto-updated.

Last update: 2024-11-16 12:25:19 UTC


README

This is a simple and lightweight String manipulation library

It is a work in progress and features will be added often

install with composer:

composer require abdellahramadan/string
use AbdellahRamadan\String\Strings;

Slug a text

$text = Strings::slug("this is a simple slug");

echo $text; // this-is-a-simple-slug

Make a text lowercase

$text = Strings::lowercase("I will be MADE A LOWERCASE");

echo $text; // i will be made a lowercase

Search a word

$sentence = "I want to find a word";

Strings::contains($sentence, "find"); // true

Add a prefix

$text = "is a cool language";

echo $completeText = Strings::prefix($text, "PHP"); // PHP is a cool language

And much more...

More string manipulations is being Added

Testing

Test is available in the test folder and can be run with:

vendor/bin/phpunit

Contributing

Contributions are welcome 😃

Licence

MIT Licence