I want to create a 12 number alphabet as range in PHP like (“ Db8jhCn9HMUZ”) it includes lower and upper case letter numbers? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 1

I want to create a 12 number alphabet as range in PHP like (“ Db8jhCn9HMUZ”) it includes lower and upper case letter numbers?

I tried but got only range in lower or uppercase and in numbers but I want tje mixture of it

18th Nov 2017, 3:18 PM
Hassan Raza
4 Answers
+ 1
Sorry for the late reply. so this is how you'd go $token = str_shuffle("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"); $token = substr($token, 0, 12);
18th Nov 2017, 10:16 PM
CHMD
CHMD - avatar
+ 1
create a string containing all the alphabet both in lowercases and uppercases, then str_shuffle() it, then use substr() to return a 12 character long string.
18th Nov 2017, 3:41 PM
CHMD
CHMD - avatar
+ 1
Thanks KINGDX
16th Mar 2018, 6:55 PM
Hassan Raza
0
can you send me the example or a variable includes str suffle?
18th Nov 2017, 3:49 PM
Hassan Raza