i was hoping of some kind of function that would strip away everything but the regular strings
That's where regex comes in.
For example, let's say you only want to allow printable ASCII, i.e. from 0x20 to 0x7E, tabs, new lines and carriage returns.
$str = preg_replace('/[^\t\n\r\x20-\x7E]/', '', $str);
Of course, read the PHP Manual for the details.