What is the use of str_replace() PHP String function?
The PHP str_replace() function is used to search & replace some words in a strings.
Example of str_replace()
echo str_replace("Hello", "Hi", "Hello PHP!");
In this example, “Hello” word will be replaced by “Hi” in the given string.
Run : http://ideone.com/AFs0DW
Learn more about the similar topics?
Interview Questions & Answers
Exercises & Assignments