You could compare all alphanumeric characters against the string to check if there is any special character:
$temp = '$tack0verflow_';
if(strlen($temp) == strlen(preg_replace("/[^a-zA-Z0-9]+/", "", $temp))){
// No special characters
} else {
// Has special characters
}