Php generates a random string with a specified number of digits (length)
- /**
- * Generate a string of the specified length
- * By bbs.it-home.org
- */
- Function create_random_string ($ random_length ){
- $ Chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789 ";
- $ Random_string = '';
- For ($ I = 0; $ I <$ random_length; $ I ++ ){
- $ Random_string. = $ chars [mt_rand (0, strlen ($ chars)-1)];
- }
- Return $ random_string;
- }
The random string value range is random {0-9, A-Z, a-z. >>> Articles you may be interested in: PHP random string generation function php random string generation function PHP two examples of generating random string PHP two methods of generating random string a simple php random generation string function very useful three PHP random string function generator php generate random number example php create readable random string code use php generate a random string code php generate random numbers and letters instance code |