The php-mbstring-extension
is a PHP library that provides support
for multibyte strings that are not covered by the standard PHP string
functions.
Version | PHP | Documentation |
---|---|---|
^2.0 | ^8.0 | current |
PHP
>= 8.0- php-extension
ext-mbstring
To acquire the package, utilize the composer package manager.
composer require mathiasreker/php-mbstring-extension
Calculate the Levenshtein distance between two strings.
\MathiasReker\PhpMbFunctions\Mbstring::levenshtein(
string $s1,
string $s2,
int $cost_ins = 1,
int $cost_rep = 1,
int $cost_del = 1
): int
Uppercase the first character of each word in a string.
\MathiasReker\PhpMbFunctions\Mbstring::ucwords(
string $string,
string $encoding = 'UTF-8'
): string
Make the first character of a string uppercase.
\MathiasReker\PhpMbFunctions\Mbstring::ucfirst(
string $string,
string $encoding = 'UTF-8'
): string
Reverse a string.
\MathiasReker\PhpMbFunctions\Mbstring::strrev(
string $string,
string $encoding = 'UTF-8'
): string
Returns information about characters used in a string.
\MathiasReker\PhpMbFunctions\Mbstring::count_chars(
string $string,
int $mode,
string $encoding = 'UTF-8'
): array|string
Multibyte-aware trim function.
\MathiasReker\PhpMbFunctions\Mbstring::trim(
string $str,
string $charlist = " \t\n\r\0\x0B"
): string
See the open issues for a complete list of proposed features (and known issues).
If you have a suggestion to enhance this project, kindly fork the repository and create a pull request. Alternatively, you may open an issue and tag it as "enhancement". Lastly, do not hesitate to give the project a star ⭐. Thank you for your support.
If you are utilizing Docker, the following command can be used to initiate the process:
docker-compose up -d
Next, access the container:
docker exec -it php-mbstring-extension bash
PHP Coding Standards Fixer:
composer cs-fix
PHP Coding Standards Checker:
composer cs-check
Rector Fixer:
composer rector-fix
Rector Checker:
composer rector-check
PHP Stan:
composer phpstan
Unit tests:
composer test
The distribution of the package operates under the MIT License
. Further information can be found in the LICENSE file.