Effect demonstration
First generation method: o6rkNmI0f
Second Generation Method: 745 IFsXt?
PHP code
Method 1
<? Php $ password_length = 9; function make_seed () {list ($ usec, $ sec) = explode ('', microtime (); return (float) $ sec + (float) $ usec * 100000);} srand (make_seed (); // random character set $ alfa = "1234567890 bytes"; $ token = ""; for ($ I = 0; $ I <$ password_length; $ I ++) {$ token. = $ alfa [rand (0, strlen ($ alfa)];} echo $ token;?>
Second Generation Method
<? Php // create password $ totalChar = 8; // Number of strings in the password // salt to select chars from $ salt = "regular"; srand (double) microtime () * 1000000); // start the random generator $ Spass = ""; // set the initial value for ($ I = 0; $ I <$ totalChar; $ I ++) // create a password cyclically $ Spass = $ Spass. substr ($ salt, rand () % strlen ($ salt), 1); echo $ Spass;?>?