I have 62 base64 characters that I want to randomize. How can I do this using PHP? The string would be all letters, upper and lower case as well as numbers from 0-9.
The thing that is most important to me is that the entire string be evaluated before a return value is given. In other words, if I request a string of 8 characters in length and my string starts out like:
1234567890ABCDE….. I don’t want to get the first 8 numbers randomized. It should randomize the entire string first, then return 8 characters from that.
Try this:
str_shuffle randomizes the string, then substr takes the first 8 characters from it.