I found in the PHP
documentation the substr_replace
function but it does not do exactly what I want, it simply replaces a string that I pass as a parameter by another substring. What I want is to pass a string and within that string replace all occurrences of a given substring with another.