Here’s a very handy little snippet for stripping all non-alphanumeric characters from a string:
$string = preg_replace("/[^A-Za-z0-9]/", "", $string);
This will leave all letters (whether they are capitalized or lowercase) as well as numbers 0 through 9.