How to replace given characters inside string variable using user given in php.
Str_replace() function is used to replace characters of a string variable with user given characters and update the string after replacing process. So here is the complete step by step tutorial for Use str_replace function in php to replace string word.
How to Use str_replace function in php to replace string word.
Code for str_replace_function.php file.
<?php $blog = "Android Tutorials"; //Replacing Android with PHP in $blog string. echo str_replace("Android", "PHP", $blog); ?>
Screenshots: