{ Frameless }

replace($input, $pattern, $replacement, $flags)

The replace($input, $pattern, $replacement) or replace($input, $pattern, $replacement, $flags) function returns a new string, created by replacing any substrings that match the given regular expresion given by the $pattern argument, with the value of the $replacement argument.

Arguments

ArgumentType
$inputxs:string
$patternxs:string
$replacementxs:string
$flagsxs:string
Return valuexs:string

Examples

replace("frameless", "me", "*")"fra*less"
replace("abracadabra", "a.*a", "*")"*"
replace("AAA", "A+?", "b")"bbb"