Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function gerarsenha() {
- $letras = "abcdefghijklmnopqrstuvwxyz";
- $numeros = "0123456789";
- $senha = "";
- srand(time());
- for ($j = 0; $j != 12; $j++) {
- $bin = rand(0,1);
- if($bin == 1) {
- $letra = rand(0,25);
- $senha = $senha.$letras[$letra];
- }
- else {
- $numero = rand(0,9);
- $senha = $senha.$numeros[$numero];
- }
- }
- echo $senha;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement