I don't know perl language, but i am trying to customize an application written in perl language. I want to know the logic or meaning of the following perl code. I know this code is for generating a random string, but i want its details i.e i want to know how can i generate this same random string in PHP? Please anyone give me the PHP code for this perl code!!
sub generate_rand_string {
#warn "generate_rand_string";
my $chars = shift
|| 'aAeEiIoOuUyYabcdefghijkmnopqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789';
my $num = shift || 1024;
require Digest::MD5;
my @chars = split '', $chars;
my $ran;
for ( 1 .. $num ) {
$ran .= $chars[ rand @chars ];
}
return Digest::MD5::md5_hex($ran);
}
Please anyone help me!!!!