4 ms·
strlen and strpos are two fairly commonly used functions that come to mind.
by Zancarius 13y ago
strlen and strpos are two fairly commonly used functions that come to mind.
- desas 13y agoUse mb_strlen and mb_strpos instead where the string may contain multibyte characters.
- Zancarius 13y agoOr patchwork/utf8 [1] since it handles fallback in the event mb_* isn't installed and can utilize several other libs. [1] https://github.com/nicolas-grekas/Patchwork-UTF8 https://github.com/nicolas-grekas/Patchwork-UTF8