Use the str_replace () function to replace the characters. You can also use the substr_replace () function, which substitutes characters in a specific spot.