substr()
function substr(string $string, int $offset, ?int $length = null): string
Returns a portion of a string specified by the offset and length.
Parameters:
$string(string)$offset(int)$length(?int), defaultnull, optional
Returns: string
Availability
| Compiled (AOT) | Magician (eval) |
|---|---|
| Available | Available |
No examples yet. Check examples/ and showcases/ for usage patterns.
Internals
For how substr is implemented in the compiler, see the internals page.