← All docs
mb_substr()
Selects a substring using character offsets and an optional character length.
mb_substr()
function mb_substr(string $string, int $start, ?int $length = null, ?string $encoding = null): string
Selects a substring using character offsets and an optional character length.
Parameters:
$string(string)$start(int)$length(?int), defaultnull, optional$encoding(?string), defaultnull, optional
Returns: string
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_substr.rs).
No examples yet. Check examples/ and showcases/ for usage patterns.
Internals
For how mb_substr is implemented in the compiler, see the internals page.