In what scenarios is str_replace more suitable than preg_replace for manipulating strings in PHP?

str_replace is more suitable than preg_replace when you need to simply replace a specific substring in a string without using regular expressions. If you know the exact string you want to replace, using str_replace is faster and more efficient than preg_replace, which is designed for more complex pattern matching scenarios.

// Using str_replace to replace a specific substring in a string
$string = "Hello, World!";
$new_string = str_replace("Hello", "Hi", $string);
echo $new_string; // Output: Hi, World!