# RFC: mb_str_split() Split multibyte string

- Status: Implemented (PHP 7.4)
- Authors: rumi, legale.legale@gmail.com
- Date: 2019-01-02
- Original: https://wiki.php.net/rfc/mb_str_split
- Page: https://externals.io/rfc/mb_str_split
- More for agents: search with https://externals.io/search.md?q={query} · RFCs at https://externals.io/rfc.md · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

## Votes

### Include mb_str_split into next PHP-7.x? (closed)

Yes: 10 · No: 1

Voters: ashnazg (Yes), colinodell (Yes), galvao (Yes), girgias (Yes), kalle (Yes), kguest (Yes), lex (Yes), mcmic (Yes), petk (Yes), salathe (No), yunosh (Yes)

## Discussions on the mailing list

- [RFC mb_str_split](https://externals.io/message/103664.md) — started on 2019-01-02, 1 messages
- [\[RFC\]\[VOTE\] mb_str_split](https://externals.io/message/103684.md) — started on 2019-01-05, 7 messages
- [\[RFC\]\[VOTE\] mb_str_split](https://externals.io/message/103712.md) — started on 2019-01-10, 1 messages
- [reasonability of change the mbfl library](https://externals.io/message/104331.md) — started on 2019-02-10, 6 messages

---

## Introduction

mb\_str\_split is a function to perform string splitting to an array of defined size chunks.

### Description

`array mb_str_split (string $string [, integer $split_length = 1, string $encoding = mb_internal_encoding() ])`

The function works through the libmbfl library and supports all libmbfl supported charsets just like other mbstring functions.

### Usage example

```php
<?php 
print_r(mb_str_split("победа", 2));
 
--EXPECT--
 
Array
(
    [0] => по
    [1] => бе
    [2] => да
)
```

## Proposal

Include function into the existent mbstring extension.

## Proposed PHP Version(s)

next PHP-7.x

## RFC Impact

### To Existing Extensions

mbstring

### To Opcache

Opcache is not affected.

### New Constants

No.

## Open Issues

No.

## Future Scope

No.

## Proposed Voting Choices

This project requires 50%+1 majority. The voting period: from 2019-01-10 to 2019-01-20.

**Vote: Include mb\_str\_split into next PHP-7.x?** — Yes: 10 · No: 1 (closed)

## Patches and Tests

<https://github.com/php/php-src/pull/3715><https://github.com/php/php-src/pull/3808>

## Implementation

1. Was merged into master (PHP-7.4)
2. <https://github.com/php/php-src/commit/d77ad27415a34e4f5908cb262567b7b6f0eca17f>
