That's not replacing non-ASCII characters... Ascii characters are inside of the range 0-127. So basically what you're trying to do is write a rexeg to convert one character set to another (not just replace out some of the characters, which is a lot harder)...
As for what you want to do, I think you want the iconv
function... You'll need to know the input encoding, but once you do you can then tell it to ignore non-representable characters:
$text = iconv('UTF-8', 'ASCII//IGNORE', $text);
You could also use ISO-8859-1
, or any other target character set you want.