Categories
functions php

PHP: Function to replace pattern of characters in a String

The functions str_replace is used to replace particular sequence of characters in a string.
Usage
[php]
str_replace(find,replace,str)
[/php]
here
find –> sequence of characters to be replaced
replace –> sequence of characters with which it is to be replaced
str –> the string inwhich modifications must be done.

example
[php]
str_replace(“ad”,”br”,”google ads”);
[/php]
the out put will be
[php]
google brs
[/php]