» Find/Replace by thebra |
|
(Login to remove green text ads)
Here is how easy it is to replace characters in a string.
PHP Code:
<?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,strin g_2_search)
This can be usefull for many different things. Such as you can remove unwanted words (dirty words!) from a message board.
|
|