is it possible to run str_ireplace without it destroying the original casing?
For instance:
$txt = \"Hello How Are You\";
$a = \"are\";
$h = \"hello\
Not beautiful, but should work.
function str_replace_alt($search,$replace,$string)
{
$uppercase_search = strtoupper($search);
$titleCase_search = ucwords($search);
$lowercase_replace = strtolower($replace);
$uppercase_replace = strtoupper($replace);
$titleCase_replace = ucwords($replace);
$string = str_replace($uppercase_search,$uppercase_replace,$string);
$string = str_replace($titleCase_search,$titleCase_replace,$string);
$string = str_ireplace($search,$lowercase_replace,$string);
return $string;
}