Grizzley g
New member
I wish to have the first three characters of a user's first name concatenate to a random 6 digit numeral creating something like hyu123654 which I could store into the database for that user as the user's memberID.
But how the heck would the code work?
I thought I'd extract the first three letters from the first name and then use a rand() to create a 6 digit numeral, but the problem is I know neither how to extract the first three letters from a given string or to concatenate it to the random digit number that I created. Please help.
The memberID need not be the way I have presented it but rand() can repeat a randomized number, and I do not want repetitions (hence, the three-letter prefix). If there's a simpler way to deal with unique memberIDs, that'd work, too.
But how the heck would the code work?
I thought I'd extract the first three letters from the first name and then use a rand() to create a 6 digit numeral, but the problem is I know neither how to extract the first three letters from a given string or to concatenate it to the random digit number that I created. Please help.