What is the function in PHP that can be used to replace specific characters in a string?

To replace specific characters in a string in PHP, you can use the `str_replace()` function. This function takes three parameters: the character or characters you want to replace, the character or characters you want to replace them with, and the string in which you want to perform the replacement. Here is a code snippet demonstrating how to use `str_replace()` to replace specific characters in a string:

$string = "Hello, World!";
$new_string = str_replace(",", "!", $string);
echo $new_string; // Output: Hello! World!