Often I find that generating a random string can be tedious, there seem to be so many ways to do this.
I wrote this simple function to do the work, and it can be easily modified.
You can remove any of the ranges in $characters (for example if you didn't want uppercase letters delete the range('A','Z')) or put in your own array of characters.