php-extended / polyfill-php74-mb-str-split
A polyfill that adds the mb_str_split function added in php7.4 to previous versions of php
1.1.0
2022-05-31 07:32 UTC
Requires
- php: >=7.2
Requires (Dev)
README
A polyfill that adds the php74 mb_str_split function added in php7.4 to previous versions of php.
Installation
The installation of this library is made via composer.
Download composer.phar
from their website.
Then add to your composer.json :
"require": {
...
"php-extended/polyfill-php74-mb-str-split": "^1",
...
}
Then run php composer.phar update
to install this library.
The autoloading of all classes of this library is made through composer's autoloader.
Basic Usage
This library gives the function mb_str_split(string $string , int $length = 1 , ?string $encoding = null) : string[]
:
$res = \mb_str_split('foobar', 3, 'UTF-8');
// $res is ['foo', 'bar']
License
MIT (See license file).