<?php
function gerarCobinacao($tam){
$seed = str_split('abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789'); shuffle($seed); // probably optional since array_is randomized; this may be redundant $rand = '';
$rand .= $seed[$k];
return $rand;
}
print gerarCobinacao(5);
PD9waHAKCmZ1bmN0aW9uIGdlcmFyQ29iaW5hY2FvKCR0YW0pewogICAgJHNlZWQgPSBzdHJfc3BsaXQoJ2FiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6QUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVowMTIzNDU2Nzg5Jyk7CiAgICBzaHVmZmxlKCRzZWVkKTsgLy8gcHJvYmFibHkgb3B0aW9uYWwgc2luY2UgYXJyYXlfaXMgcmFuZG9taXplZDsgdGhpcyBtYXkgYmUgcmVkdW5kYW50CiAgICAkcmFuZCA9ICcnOwogICAgZm9yZWFjaCAoYXJyYXlfcmFuZCgkc2VlZCwgJHRhbSkgYXMgJGspIAogICAgICAkcmFuZCAuPSAkc2VlZFska107CgogICAgcmV0dXJuICRyYW5kOwogfQoKcHJpbnQgZ2VyYXJDb2JpbmFjYW8oNSk7