Take the 2-minute tour ×  Recently I found a function to
generate a random string of numbers and letters, and It was
really compact and concise and I liked it alot. The problem Is I
have no idea what it is doing, or how to modify it.  Please can
someone just explain to me step by step what is going on here. I
have tried looking up the functions alone but they don't seem to
explain the things like 0x19A100 etc.  I would like to modify it
to produce the same random string but only around 4 or 5 lettes
long. I don't just want to take the first few letters though, I
wan't the function to properly produce. I am trying to learn!
Here is the code:  function genRndStr()      {   return
strtoupper(base_convert(mt_rand(0x19A100, 0x39AA3FF), 35, 36));
}  Any help greatly appreciated! Thank you.  share|improve this
question add comment  2 Answers  mt_rand generates random
numbers between (min, max). The numbers 0x19A100, 0x39AA3FF are
simply the min and max values in hexadecimal format:  0x19A100 =
1 679 616 0x39AA3FF