I have a little script that is used to generate a random string of 25 characters. It works about 70% of the time and other times it creates strings that are only 10.
$unique = substr(md5(microtime()),rand(0,26),25);
My goal is to have a random string of (lower case) letters and numbers without having to create a function
This is becouse you are cutting it to a random length with rand(0, 26).
Try this instead: