/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/helpers/utf8/str_split.php
27 строк
526 B
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php use common\helpers\Utf8Helper; /** * Utf8Helper::str_split */ function _str_split($str, $split_length = 1) { $split_length = (int)$split_length; if (Utf8Helper::isAscii($str)) { return str_split($str, $split_length); } if ($split_length < 1) { return false; } if (Utf8Helper::strlen($str) <= $split_length) { return array($str); } preg_match_all('/.{' . $split_length . '}|[^\x00]{1,' . $split_length . '}$/us', $str, $matches); return $matches[0]; }