Shuffles a string randomly
by Nithya[ Edit ] 2012-05-21 12:12:50
str_shuffle() shuffles a string
$str = 'rtewtfsdf';
$shuffled = str_shuffle($str);
Simple random password generator using str_shuffle
function random_password($chars=11)
{
$letters = 'abcefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890';
return substr(str_shuffle($letters), 0, $chars);
}
$res = random_password();
echo $res;