Here's a simple version of my problem:
<?php
$words = "hEllO wOrLD"; //the input (is usually always different each time)
$phrase = "I made a program which prints Hello World";
$result = str_ireplace("$words", "<b>$words</b>", "$phrase"); //str_ireplace(search_for, replace_with, apply_to)
echo $result;
?>
This would produce the output "I made a program which prints hEllo wOrLD"
What I want to do is that for any value in the variable $words (capital letter or non capital) to not affect the casing of the part of $phrase which is to be bolded. So Ideal output would be "I made a program which prints Hello World"
I'll repeat: The casing (capital or small) of the part which is to be bolded should not change.