Php > Algorithms
Creates a random string of x characters, using a defined string of possible characters
Creates a random string of x characters, using a defined string of possible characters function randomString($len) { srand(date("s")); $possible="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234567890!@#$%^&*()"; $str=""; while(strlen($str)<$len) { $str.=substr($possible,(rand()%(strlen($possible))),1); } return($str); } ?>
Php Codes
Algorithms
Arrays
Authentication
Calendar
Code Snippets
Programs
Content Manage
Contest Related
Cookies
Credit Cards
DBase Related
Databases
Date Time
Directories
E-Mail
Errors
File
File System
Forms
Handling
Graphics
HTML and PHP
Informix
Ingres
InterBase
LDAP
Look and Feel
Miscellaneous
MySQL
Other
PHP Classes
Searching
Navigation
Statistics
Strings
User Manage