This snippet helps you to Generate Random Password
Function
Function
- <?php
- function Generate_Random($len, $set = "") {
- $generate = "";
- for($i=0;$i<$len;$i++) {
- $set = str_shuffle($set);
- $generate .= $set[0];
- }
- return $generate;
- }
- ?>
Usage of function
- $Password=Generate_Random(10,'1234567890qwertyuiopasdfghjklzxcvbnm');
- echo $Password;
In the first line inside the brackets you have to put how many characters to be generated(10) after that you need to add the characters that to be randomly generated(1234567890qwertyuiopasdfghjklzxcvbnm).
Recently I wrote something like this, you can view that article from this link.
Recently I wrote something like this, you can view that article from this link.
Post a Comment
Note: Only a member of this blog may post a comment.