Made a quick function. I think this should do the job.
function newStr_replace($string, $start, $end, $replace) {
$number = $end - $start + 1;
$string = substr_replace($string, $replace, $start, $number);
return $string;
}
This:
echo newStr_replace("123456789", 2, 5, "");
Returns:
12789 (it starts at pos 2 (3 in this case b/c you start at 0), and ends (also deletes) at pos 5 (6 in this case))
Hope thats what you wanted