Skip to content

Instantly share code, notes, and snippets.

@thebouv
Created February 19, 2014 16:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thebouv/9095425 to your computer and use it in GitHub Desktop.
Save thebouv/9095425 to your computer and use it in GitHub Desktop.
PHP random string generation (for file names, etc)
function getRandom($length = 10) {
return substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, $length);
}
@thebouv
Copy link
Author

thebouv commented Feb 19, 2014

NOT for password generation of course.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment