substr_count()
function substr_count(string $haystack, string $needle, int $offset = 0, mixed $length = null): int
Counts the number of non-overlapping substring occurrences.
Parameters:
$haystack(string)$needle(string)$offset(int), default0, optional$length(mixed), defaultnull, optional
Returns: int
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): not available inside eval’d code.
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how substr_count is implemented in the compiler, see the internals page.