Heh, I knew i could figure something out that didn't use regular expressions :o
function stri_replace($replacer,$replacement,$string) {
$position = 0;
while($position < strlen($string)-strlen($replacer)) {
$word = substr($string,$position,strlen($replacer));
if(!strcasecmp($replacer,$word)) {
$string = str_replace($word,$replacement,$string);
$position += (strlen($replacement)-1);
}
$position++;
}
return $string;
}
Maybe not the very best way, but it seems to work for me properly as a case-insensitive regular expression replacement would.
-Josh