Home / PHP Tips Generated By ChatGPT / Replacing Text within a String Using str_ireplace() in PHP Case-insensitive version of str_replace(). Source Code echo str_ireplace("world", "PHP", "Hello world!"); // Outputs: Hello PHP!