What is the issue with str_replace when it comes to distinguishing between uppercase and lowercase letters in PHP?

When using str_replace in PHP, it does not distinguish between uppercase and lowercase letters by default. To solve this issue, you can use the str_ireplace function instead, which performs a case-insensitive search and replace.

// Example code snippet using str_ireplace to replace text case-insensitively
$string = "Hello World";
$new_string = str_ireplace("hello", "hi", $string);
echo $new_string; // Output: "Hi World"