Answer the question
In order to leave comments, you need to log in
Is there a service/script/utility for generating nicknames for e-mail by full name?
There is a list of full names of employees (our, domestic).
It is necessary to generate an appropriate list of nicknames (in Latin).
For example
, Fadey Apollinarievich Parashyutov - Fadey.AP
The task is nonsense, but there are already enough bicycles.
Thank you.
Answer the question
In order to leave comments, you need to log in
php.net/manual/ru/class.transliterator.php
php.net/manual/en/function.iconv.php //TRANSLIT - not everyone works
Well, it's simple
function ru2Lat($string)
{
$rus = array('ё','ж','ц','ч','ш','щ','ю','я','Ё','Ж','Ц','Ч','Ш','Щ','Ю','Я');
$lat = array('yo','zh','tc','ch','sh','sh','yu','ya','YO','ZH','TC','CH','SH','SH','YU','YA');
$string = str_replace($rus,$lat,$string);
$string = strtr($string,
"АБВГДЕЗИЙКЛМНОПРСТУФХЪЫЬЭабвгдезийклмнопрстуфхъыьэ",
"ABVGDEZIJKLMNOPRSTUFH_I_Eabvgdezijklmnoprstufh_i_e");
return($string);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question