o anche questo!
trovato sul sito php (http://it2.php.net/manual/it/function.rand.php)
Codice PHP:
/*
Yet another random password generator, but this one creates readable/pronounceable passwords...
*/
<?php
function randompass()
{
$rand_pass = ''; // makes sure the $pass var is empty.
for( $j = 0; $j < 3; $j++ )
{
$startnend = array(
'b','c','d','f','g','h','j','k','l','m','n',
'p','q','r','s','t','v','w','x','y','z',
);
$mid = array(
'a','e','i','o','u','y',
);
$count1 = count( $startnend ) - 1;
$count2 = count( $mid ) - 1;
for( $i = 0; $i < 3; $i++)
{
if( $i != 1 )
{
$rand_pass .= $startnend[rand( 0, $count1 )];
}
else
{
$rand_pass .= $mid[rand( 0, $count2 )];
}
}
}
return $rand_pass;
}
$rand_pass = randompass();
echo '
pass: [b]' . $rand_pass . '[/b]</p>';
echo '
md5: [b]' . md5( $rand_pass ) . '[/b]</p>';
?>
/*
Some examples are:-
pohyerdib
kibkudjam
fizvoszeb
jyshevram
Easy to remember (since it's basically 3, 3 letter words)
I've put a y in the list of vowels since it works well as a middle letter in the 3 letter words.
This is excellent for a random password generator for a 'forgot password' type function.
*/