Is there a potential issue with using str_replace for MultiByte characters in PHP?

When using `str_replace` for MultiByte characters in PHP, there is a potential issue because `str_replace` is not MultiByte safe. This can lead to unexpected results or corrupted characters when replacing MultiByte strings. To solve this issue, you can use the `mb_str_replace` function instead, which is MultiByte safe and can handle MultiByte characters properly.

function mb_str_replace($search, $replace, $subject) {
    return implode($replace, mb_split($search, $subject));
}

// Example usage
$original_string = "Hello, こんにちは";
$search = "こんにちは";
$replace = "Goodbye";
$new_string = mb_str_replace($search, $replace, $original_string);

echo $new_string; // Output: Hello, Goodbye