ctype_alnum($string);
<?php function alphanumeric($string){ $string = preg_replace("/[^a-zA-Z0-9\s]/", "", $string); return $string; } ?>