virt2/api/php/genpass.php

9 lines
330 B
PHP
Raw Permalink Normal View History

<?php
function generate_password($number)
{$arr = array('a','b','c','d','e','f', 'g','h','i','j','k','l','m','n','o','p','r','s','t','u','v','x','y','z','1','2','3','4','5','6','7','8','9','0');
$pass = "";
for($i = 0; $i < $number; $i++){
$index = rand(0, count($arr) - 1);
$pass .= $arr[$index];}
return $pass;}
?>