$s = 'äëüïö'; if (preg_match('/&[a-zA-Z]uml;/',htmlentities($s,ENT_COMPAT,'UTF-8'))) { echo 'Filename contains umlaut'; }