Find/Replace
Here is how easy it is to replace characters in a string.
<?php $the_string = 'I love beans!'; //replace beans with cheese $the_string = str_replace("beans","cheese",$the_string); echo $the_string; ?>
This will output:
I love cheese!
----------------------------
String replace works like this:
str_replace(word_2_replace,replace_with_word,string_2_search);
Post new comment