PHP Demo
PHP Code
Output
A demo of string replace in PHP
< ?php $arr_repl = array("This", "function"); $source_string= "This is a replace string tutorial by using str_replace function."; $str_replaced = str_replace($arr_repl, "that", $source_string); echo "The source string:
" .$source_string ."
"; echo "The replaced string:
" .$str_replaced; ?>
A demo of string replace in PHP
The source string:
This is a replace string tutorial by using str_replace function.
The replaced string:
that is a replace string tutorial by using str_replace that.