$s = "abcšđč枊ĐČĆŽkdfef"; if (!preg_match("/^[0-9a-zA-Zšđč枊ĐČĆŽ]*$/", $s)) exit("NE."); echo "da";