public static function random($length = 10, $isReadable = true)
{
$result = '';
if ($isReadable) {
$vocal = array('a', 'e', 'i', 'o', 'u', '0');
$conso = array('b', 'c', 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'm', 'n', 'p', 'r', 's', 't', 'v', 'w', 'x', 'y', 'z', '1', '2', '3', '4', '5', '6', '7', '8', '9');
$max = $length / 2;
for ($pos = 1; $pos <= $max; $pos++) {
$result .= $conso[mt_rand(0, count($conso) - 1)];
$result .= $vocal[mt_rand(0, count($vocal) - 1)];
}
} else {
$chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for ($pos = 0; $pos < $length; $pos++) {
$result .= $chars[mt_rand() % strlen($chars)];
}
}
return $result;
}