Support the ongoing development of Laravel.io →
posted 9 years ago
Input

Hi, pls i want to generate an 8 character random key that support both alphabetic and numeric characters, in this format (e029d2f2) i need it to generate at least 2 million of this random keys for a project i am working on. so how i do that in laravel php.

Last updated 3 years ago.
0

The same way you would do it in php :)

How random does it need to be?

substr(str_shuffle(MD5(microtime())), 0, 8);
0

Sign in to participate in this thread!

Eventy

Your banner here too?

ubilli ubilli Joined 10 Jun 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.