LaravelPackages.net
Acme Inc.
Toggle sidebar
webikevn/wstring

PHP String Utilities

13
1
1.0.2
About webikevn/wstring

webikevn/wstring is a Laravel package for php string utilities. It currently has 1 GitHub stars and 13 downloads on Packagist (latest version 1.0.2). Install it with composer require webikevn/wstring. Discover more Laravel packages by webikevn or browse all Laravel packages to compare alternatives.

Last updated

webikevn/wstring

This librairy provides utilities function to ease string manipulation

Install

Install package with composer

composer require webikevn/wstring

In your PHP code, load library

require_once __DIR__ . '/../vendor/autoload.php';
use Webike\WString\WString as WString;

Note: I couldn't use String as namespace because it's a PHP reserved word so it's why namespace is WString ...

Usage

Replace the last occurrence of a string

$string = WString::strReplaceLast($search, $replace, $subject);

Checks whether a string starts with given chars

$bool = WString::startsWith($haystack, $needle);

Checks whether a string ends with given chars

$bool = WString::endsWith($haystack, $needle);

Unit Tests

phpunit --bootstrap vendor/autoload.php tests

Author

Nguyen Giang visit my website ;)

Star History Chart