How can I limit the following code to generate 8 mixed characters and number in the code below.
Here is the PHP code.
md5(uniqid(rand(1,6)));
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A md5 hash is always 32 characters long ; that’s what an md5 is.
But you could choose to use only 8 characters from the string returned by the
md5()function, with thesubstrfunction.For example, to keep only the first eight characters, you could use something like this :
And it would get you something like this :