Simple. PHP: $string = '{SEARCH}';$string = str_replace('{SEARCH}', '{REPLACED}', $string);var_dump($string); //string(8) {REPLACE}
Can also be a file, PHP: touch("random_file.txt");file_put_contents("random_file.txt", "{SEARCH}");$file = file_get_contents("random_file.txt");str_replace("{SEARCH}", "{REPLACED}", $file);
Btw, whenever you are not sure anymore about the usage, look it up on php.net, just search php str_replace
Because, I'm saying it can also be used to search/replace in a file, which is useful. And, yes, pretty much.
Btw, this is a bit of code that allows you to replace strings found in an associative array. For example: PHP: <?php$replace = array( 'dog' => 'cat','apple' => 'orange','chevy' => 'ford' );$string = 'I like to eat an apple with my dog in my chevy';echo str_replace_assoc($replace,$string); // Echo: I like to eat an orange with my cat in my ford Here is the function: PHP: <?php function strReplaceAssoc(array $replace, $subject) { return str_replace(array_keys($replace), array_values($replace), $subject); }?> From www.php.net