Good day!
How do I add letters Ukrainian and numbers.

Here is the code

//* Проверка имени *// if(isset($user_name)){ if(strlen($user_name) >= 2){ if(!preg_match("/^[a-zA-Zа-яА-Я-Є-Їa-zа-я]+$/iu", $user_name)) $errors = 3; } else $errors = 2; } else $errors = 1; 

// Check the last name //

  if(isset($user_lastname)){ if(strlen($user_lastname) >= 2){ if(!preg_match("/[Є-Їa-zа-я-Є-Їa-zа-я]+/iu", $user_lastname)) $errors_lastname = 3; } else $errors_lastname = 2; } else $errors_lastname = 1; $row2 = $db->super_query("SELECT verification FROM `".PREFIX."_users_param` WHERE user_id = '{$user_id}'"); if(!$errors AND !$row2['verification']){ if(!$errors_lastname){ $user_name = ucfirst($user_name); $user_lastname = ucfirst($user_lastname); $db->query("UPDATE `".PREFIX."_users` SET user_name = '{$user_name}', user_lastname = '{$user_lastname}', user_search_pref = '{$user_name} {$user_lastname}' WHERE user_id = '{$user_id}'"); mozg_clear_cache_file('user_'.$user_id.'/profile_'.$user_id); mozg_clear_cache(); } else echo $errors; } else echo $errors; die(); break; 
  • digits \d - nitive
  • In the sense of? ) - praysu
  • /^[\w\d]+$/iu should work. - etki
  • Do you need only Ukrainian letters? English and the rest should not be? Then \ w will not work. In addition, \ w already contains digits and underscore (is it not needed?). The question of backfill (off topic) - and why are you accessing the database when you had an error in the name or surname? And who taught you the logic and display in one place to store? Get rid of this habit - logic in one place, display in another. And if this check starts to slow down one day, try the index by (user_id; verification). - BOPOH
  • Does not work. Writes symbols vseravno specially - praysu

0