PHP iterative verification I want to register a user now, but the user and password do not need to be filled in by the user. it is generated by the system and I wrote a function by myself, I used mt_rand to do this, so I was afraid of repetition. I wrote a static method in the class. I can use myclass: chkeuser for verification to see if I already have this username and password, but I think the value is verified once, but no. if it is repeated next time, should it be verified? if it is not repeated, then I think of iteration, but how can I write it, my head is blurred. may I ask you?
Reply to discussion (solution)
First, insert a user into the database to obtain the unique id of the user. then, the user is equal to the value of user + id and can be directly generated by user id obfuscation.
For example, if the user ID is 3090, the user name is user3090, and the password is md5 ('Your private key'. 3090). This will certainly not be repeated.
No one has ever done anything else ??
I don't know what you want to verify? It doesn't matter if the password is repeated.
Isn't user verification a select statement? If the number is greater than 0, it will be repeated.
What is next? Next random value? Put all the usernames into the array. won't inarray be used to identify them? no iteration is required.