Sometimes, We need to Generate Random Password for the Websites or the Web Application. And There Are Many Ways to Generate Password Randomly.Here Show How to Generate Random Password Using Simple Function.
Script For Generate Password:
1 2 3 4 5 6 7 | <?php function random_password($length) { $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?"; $password = substr( str_shuffle( $chars ), 0, $length ); return $password; } ?> |
In This code Use the str_shuffle String Function To Generate the Random Password .Here is The code for how to run function to Get the output of function.
1 2 3 | <?php echo random_password(8); ?> |
In This code What ever Length You Want for Password Just Replace in function's Argument.If You Want Password length 10 Just Replace on 8 to 10.
Sign up here with your email

1 comments:
Write commentsNice one...Dude..!!:-bd
ReplyConversionConversion EmoticonEmoticon