← All docs
mb_strpos()
Finds the first character position of an encoded substring, or returns false.
mb_strpos()
function mb_strpos(string $haystack, string $needle, int $offset = 0, ?string $encoding = null): int|false
Finds the first character position of an encoded substring, or returns false.
Parameters:
$haystack(string)$needle(string)$offset(int), default0, optional$encoding(?string), defaultnull, optional
Returns: int|false
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported through a declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/string/mb_strpos.rs).
No examples yet. Check examples/ and showcases/ for usage patterns.
Internals
For how mb_strpos is implemented in the compiler, see the internals page.