function

str_replace . string . sncode

VERSIONlatest Replace all occurrences of the search string with the replacement string.

STR_REPLACE

NAME

str_replace - Replace all occurrences of the search string with the replacement string.

SYNOPSIS

str_replace(search,replace,subject)

PARAMETERS

search
The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.
replace
The replacement value that replaces found search values. An array may be used to designate multiple replacements.
subject
The string being searched and replaced on, otherwise known as the haystack.

RETURN

This function returns a string with the replaced values.

EXAMPLES

Note: In the followings examples, the _ between the { should be removed to make it work.

in:  res={_{str_replace(["ONE","TWO","THREE"],["TWO WORDS","MANY LETTERS","OTHER IDEAS"],"ONE SAMPLE")}}.
out: res=MANY LETTERS WORDS SAMPLE.

in:  res={_{str_replace(["ONE","TWO","THREE"],"test","ONE TWO SAMPLES")}}.
out: res=test test SAMPLES.

in:  res={_{str_replace("ONE","test","ONE TWO SAMPLES")}}.
out: res=test TWO SAMPLES.

AUTHOR

Written by Pusnei Sergey, <sergey@sednove.com>