str_replace()
function str_replace(string $search, string $replace, string $subject, int $count = null): string
Replaces all occurrences of a search string with a replacement string.
Parameters:
$search(string)$replace(string)$subject(string)$count(int), defaultnull, optional
Returns: string
Availability
- Compiled (AOT): supported by the Elephc code generator.
eval()(magician interpreter): supported — declarative interpreter builtin (crates/elephc-magician/src/interpreter/builtins/string/str_replace.rs).
No examples yet — check examples/ and showcases/ for usage patterns.
Internals
For how str_replace is implemented in the compiler, see the internals page.