PHPackages                             mathiasreker/php-mbstring-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mathiasreker/php-mbstring-extension

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mathiasreker/php-mbstring-extension
===================================

The php-mbstring-extension is a PHP library that provides support for multibyte strings that are not covered by the standard PHP string functions.

2.0.0(2y ago)6146↓100%2MITPHPPHP ^8.0CI failing

Since Mar 25Pushed 1y ago1 watchersCompare

[ Source](https://github.com/MathiasReker/php-mbstring-extension)[ Packagist](https://packagist.org/packages/mathiasreker/php-mbstring-extension)[ Docs](https://github.com/mathiasreker/php-mbstring-extension)[ GitHub Sponsors](https://github.com/MathiasReker)[ RSS](/packages/mathiasreker-php-mbstring-extension/feed)WikiDiscussions develop Synced 1mo ago

READMEChangelog (3)Dependencies (5)Versions (4)Used By (0)

PHP Multibyte String Extension
==============================

[](#php-multibyte-string-extension)

[![Packagist Version](https://camo.githubusercontent.com/7b924716d4bf345b77a6a6a63c9feae49d52d25b2f7891588d3c3181fabc1f86/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f4d61746869617352656b65722f7068702d6d62737472696e672d657874656e73696f6e2e737667)](https://packagist.org/packages/MathiasReker/php-mbstring-extension)[![Packagist Downloads](https://camo.githubusercontent.com/10741124a197102e9df1c551eac5666b211b2107326e9d5e2a100085f2743025/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f4d61746869617352656b65722f7068702d6d62737472696e672d657874656e73696f6e2e7376673f636f6c6f723d253233666630303766)](https://packagist.org/packages/MathiasReker/php-mbstring-extension)[![CI status](https://github.com/MathiasReker/php-mbstring-extension/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/MathiasReker/php-mbstring-extension/actions/workflows/ci.yml)[![Contributors](https://camo.githubusercontent.com/6cbba4587e8772bbd79c50ae77f1a3062555c163653d1535a2cb3a0d86c3499f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f636f6e7472696275746f72732f4d61746869617352656b65722f7068702d6d62737472696e672d657874656e73696f6e2e737667)](https://github.com/MathiasReker/php-mbstring-extension/graphs/contributors)[![Forks](https://camo.githubusercontent.com/6709d046e195bda8b8f49b2302e8b6316c9f624d8cafe4afd572b54230011082/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f4d61746869617352656b65722f7068702d6d62737472696e672d657874656e73696f6e2e737667)](https://github.com/MathiasReker/php-mbstring-extension/network/members)[![Stargazers](https://camo.githubusercontent.com/645849e17714bfa6d578db7bce457eba84c760c07d60a3f513021323e5fa9704/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f4d61746869617352656b65722f7068702d6d62737472696e672d657874656e73696f6e2e737667)](https://github.com/MathiasReker/php-mbstring-extension/stargazers)[![Issues](https://camo.githubusercontent.com/4bc9c1ae0eac0d63ff4f46d5fa220e9e2abcfe1b301a90638445edd235c3ed2b/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6973737565732f4d61746869617352656b65722f7068702d6d62737472696e672d657874656e73696f6e2e737667)](https://github.com/MathiasReker/php-mbstring-extension/issues)[![MIT License](https://camo.githubusercontent.com/9591267c880456dc783ae0134ef129938416593560d3d3e17aa723e91552b0a1/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f4d61746869617352656b65722f7068702d6d62737472696e672d657874656e73696f6e2e737667)](https://github.com/MathiasReker/php-mbstring-extension/blob/develop/LICENSE.txt)

The `php-mbstring-extension` is a PHP library that provides support for [multibyte strings](https://www.php.net/manual/en/ref.mbstring.php) that are not covered by the standard PHP string functions.

### Versions &amp; Dependencies

[](#versions--dependencies)

VersionPHPDocumentation^2.0^8.0current### Requirements

[](#requirements)

- `PHP` &gt;= 8.0
- php-extension `ext-mbstring`

### Installation

[](#installation)

To acquire the package, utilize the composer package manager.

```
composer require mathiasreker/php-mbstring-extension
```

### Documentation

[](#documentation)

✅ levenshtein
-------------

[](#-levenshtein)

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
```

✅ ucwords
---------

[](#-ucwords)

Uppercase the first character of each word in a string.

```
\MathiasReker\PhpMbFunctions\Mbstring::ucwords(
    string $string,
    string $separators = " \t\r\n\f\v",
    string $encoding = 'UTF-8'
): string
```

✅ ucfirst
---------

[](#-ucfirst)

Make the first character of a string uppercase.

```
\MathiasReker\PhpMbFunctions\Mbstring::ucfirst(
    string $string,
    string $encoding = 'UTF-8'
): string
```

✅ strrev
--------

[](#-strrev)

Reverse a string.

```
\MathiasReker\PhpMbFunctions\Mbstring::strrev(
    string $string,
    string $encoding = 'UTF-8'
): string
```

✅ count\_chars
--------------

[](#-count_chars)

Returns information about characters used in a string.

```
\MathiasReker\PhpMbFunctions\Mbstring::count_chars(
    string $string,
    int $mode,
    string $encoding = 'UTF-8'
): array|string
```

✅ trim
------

[](#-trim)

Multibyte-aware trim function.

```
\MathiasReker\PhpMbFunctions\Mbstring::trim(
    string $str,
    string $charlist = " \t\n\r\0\x0B"
): string
```

### Roadmap

[](#roadmap)

See the [open issues](https://github.com/MathiasReker/php-mbstring-extension/issues) for a complete list of proposed features (and known issues).

### Contributing

[](#contributing)

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.

#### Docker

[](#docker)

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
```

#### Tools

[](#tools)

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
```

### License

[](#license)

The distribution of the package operates under the `MIT License`. Further information can be found in the LICENSE file.

###  Health Score

32

—

LowBetter than 72% of packages

Maintenance36

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 56.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~197 days

Total

3

Last Release

748d ago

Major Versions

1.0.1 → 2.0.02024-04-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/b742d6405ddc4231f7a61bce21257a96a588daf483e317ceec24a178fdb7692d?d=identicon)[MathiasReker](/maintainers/MathiasReker)

---

Top Contributors

[![MathiasReker](https://avatars.githubusercontent.com/u/26626066?v=4)](https://github.com/MathiasReker "MathiasReker (9 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![ceres-nghiaduong](https://avatars.githubusercontent.com/u/201516562?v=4)](https://github.com/ceres-nghiaduong "ceres-nghiaduong (1 commits)")[![kokoropie](https://avatars.githubusercontent.com/u/37841855?v=4)](https://github.com/kokoropie "kokoropie (1 commits)")

---

Tags

php-librarymb\_str\_padmb\_ucfirstmb\_ucwordsmb\_strrevmb\_count\_chars

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Rector

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mathiasreker-php-mbstring-extension/health.svg)

```
[![Health](https://phpackages.com/badges/mathiasreker-php-mbstring-extension/health.svg)](https://phpackages.com/packages/mathiasreker-php-mbstring-extension)
```

###  Alternatives

[sensorsdata/sa-sdk-php

PHP SDK for Sensors Analytics

32343.4k2](/packages/sensorsdata-sa-sdk-php)[phamda/phamda

Auto-curried function library

1922.8k](/packages/phamda-phamda)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
