replace
function, since version 1.1.5
categories: sanitizing, strings
replace(subject, search, replacement)
replace all occurrences of the search string with the replacement string within input subject string
parameters
- subject: string - input string being searched and replaced on
- search: string - the value being searched for
- replacement: string - the replacement value that replaces found search values
return type
string
example
replace('hello there', 'there', 'datakick')
replace('hello there', 'e', '')
returns
hello datakick
hllo thr