PHP uses a specified list of characters to generate random strings, PHP characters
This example describes how PHP generates random strings using a specified list of characters. Share to everyone for your reference. Specific as follows:
<?phpfunction RandomString ($len) { Srand (date ("S")); $possible = "abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&* ()"; $str = ""; while (strlen ($STR) < $len) { $str. =substr ($possible, (rand ()% (strlen ($possible))), 1); } return ($STR);}? >
I hope this article is helpful to everyone's PHP programming.
http://www.bkjia.com/PHPjc/986076.html www.bkjia.com true http://www.bkjia.com/PHPjc/986076.html techarticle PHP uses a specified list of characters to generate random strings, and PHP characters This example describes how PHP generates random strings using a specified list of characters. Share to everyone for your reference. ...