Logo

Programming-Idioms

History of Idiom 63 > diff from v26 to v27

Edit summary for version 27 by :
New PHP implementation by user [AgillaDev]

Version 26

2016-02-18, 16:58:00

Version 27

2016-02-22, 13:52:33

Idiom #63 Replace fragment of a string

Assign to x2 the value of string x with all occurrences of y replaced by z.
Assume occurrences of y are not overlapping.

Idiom #63 Replace fragment of a string

Assign to x2 the value of string x with all occurrences of y replaced by z.
Assume occurrences of y are not overlapping.

Code
$x2 = str_replace($y, $z, $x);
Origin
http://php.net/manual/en/function.str-replace.php