detect and strip out any foreign text, while keeping special characters
This echo htmlentities($str, ENT_QUOTES, "ISO-8859-1"); however gave me garbled text, maybe i can somehow detect that?
Q: what is the best way to do this?
this seems to be working when i tested it, but you will want to double check:
$output = preg_replace('/[^(\x20-\x7F)]*/','', $output);