<?php
function translet($txt)
{
$array = array("а" => "a", "б" => "b", "в" => "v", "г" => "g", "д" => "d", "е" => "e", "ё" => "e", "ж" => "zh", "з" => "z", "и" => "i", "й" => "j", "к" => "k", "л" => "l", "м" => "m", "н" => "n", "о" => "o", "п" => "p", "р" => "r", "с" => "s", "т" => "t", "у" => "u", "ф" => "f", "х" => "h", "ц" => "c", "ч" => "ch", "ш" => "sh", "щ" => "sh", "ы" => "i", "ь" => "", "ъ" => "", "э" => "e", "ю" => "ju", "я" => "ja", "А" => "a", "Б" => "b", "В" => "v", "Г" => "g", "Д" => "d", "Е" => "e", "Ё" => "e", "Ж" => "zh", "З" => "z", "И" => "i", "Й" => "j", "К" => "k", "Л" => "l", "М" => "m", "Н" => "n", "О" => "o", "П" => "p", "Р" => "r", "С" => "s", "Т" => "t", "У" => "u", "Ф" => "f", "Х" => "h", "Ц" => "c", "Ч" => "ch", "Ш" => "sh", "Щ" => "sh", "Ы" => "i", "Ь" => "", "Ъ" => "", "Э" => "e", "Ю" => "ju", "Я" => "ja", " " => "-", "\r" => "", "\n" => "",);
foreach($array as $val=>$key) $txt = str_replace($val,$key,$txt);
return $txt;
}
function GenLogin()
{
Global $file_name, $file_last_name;
return substr(translet($file_name[rand(0,count($file_name)-1)].'_'.$file_last_name[rand(0,count($file_last_name)-1)]), 0, 15).rand(10, 40);
}
$file_name=array_map('trim', file('./name.txt'));
$file_last_name=array_map('trim', file('./last_name.txt'));
echo GenLogin();
?>