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
<?php
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:
Tutorials |
---|
No Content Found. |
Exercises & Assignments |
---|
No Content Found. |
Interview Questions & Answers |
---|
No Content Found. |