K
K
kras_ai2015-05-02 16:50:33
Email
kras_ai, 2015-05-02 16:50:33

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

1 answer(s)
S
Sergey Savostin, 2015-05-02
@savostin

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);
}

And I think you will write the translation into initials yourself;)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question