jpuck / mbstring
Methods for handling multibyte string manipulations.
0.1.0
2017-10-24 22:54 UTC
Requires
- php: ^7.0
- ext-mbstring: ^7.0
Requires (Dev)
- phpunit/phpunit: ^6.4
This package is not auto-updated.
Last update: 2024-04-14 02:13:28 UTC
README
Methods for handling multibyte string manipulations.
Installation
via composer:
composer require jpuck/mbstring
Usage
See the tests for more examples.
Case Map
Creates an index of uppercase character positions in a string that can be mapped to other strings.
$original = '🔥 Foó, foó FOÓ 😁'; $casemap = new CaseMap($original); $replaced = mb_eregi_replace('foó', 'bår', $original); $restored = $casemap->transform($replaced); echo "original: $original\n"; echo "replaced: $replaced\n"; echo "restored: $restored\n";
original: 🔥 Foó, foó FOÓ 😁 replaced: 🔥 bår, bår bår 😁 restored: 🔥 Bår, bår BÅR 😁