Ci sono delle funzioni per le stringhe:

credo che tu debba utilizzare
str_replace(stringa, stringa, stringa)


ciao!