/
v.bolshakov
/
AIEcosystem-Testing
Обзор
Документация
Войти
/
v.bolshakov
/
AIEcosystem-Testing
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
CI/CD
Аналитика
Безопасность
dev
common/helpers/utf8/strpos.php
26 строк
569 B
Developer
Initial commit
03 авг 2026, 17:43
03 авг 2026, 17:43
7433917
Код
Авторство
О чём код?
<?php use common\helpers\Utf8Helper; /** * Utf8Helper::strpos */ function _strpos($str, $search, $offset = 0) { $offset = (int)$offset; if (Utf8Helper::isAscii($str) and Utf8Helper::isAscii($search)) { return strpos($str, $search, $offset); } if ($offset == 0) { $array = explode($search, $str, 2); return isset($array[1]) ? Utf8Helper::strlen($array[0]) : false; } $str = Utf8Helper::substr($str, $offset); $pos = Utf8Helper::strpos($str, $search); return ($pos === false) ? false : ($pos + $offset); }