Goto main content

str_ireplace

Replace all occurrences of the search string with the replacement string (case insensitive).

STR_IREPLACE

NAME

str_ireplace - Replace all occurrences of the search string with the replacement string (case insensitive).

SYNOPSIS

str_ireplace(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

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

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

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

SEE ALSO

{{ include("includes/strings.sn") }}

AUTHOR

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

MODIFICATIONS

1.0 2014-09-09 21:24:14 laplante@sednove.com

Edit

© 2022 extenso Inc. All rights reserved.