Passwords
|
|
|
|
<?php
function randGen($len=6) {
$possible = 'abcdefghijklmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ123456789';
$slen = strlen($possible);
$ret = '';
for($i=0; $i<$len; $i++) {
$rnd = rand(0, $slen);
$ret .= $possible{$rnd};
}
return $ret;
} ?>
|
|
|
Usage Example
|
<?php
echo randGen(10);
// will generate a password of 10 characters ?>
|
|
|
Rate This Script
|
|
|
|