Can I ask for a certain code on how to generate a random letters and numbers in one word. I know there’s a PHP function rand(), but I don’t know if it’s also applicable with letters. There’s also a function called mt_rand() but I don’t know how it works. I’m planning on generating a word like this one:
$randomcode = re784dfg7ert7;
Do you guys have any simple code on this one? Thanks in advance!
This is a more extensive method that I use constantly to generate random numbers, letters or mixed:
USAGE:
Basically I have a main function with the array, then I call secondary functions to build my string based on the length parameter:
Letters:
Numbers:
AlphaNumeric:
This Question is answered by Kerrek SB, but this may help someone searching for a more extensive and flexible way.