Random Code Generator
Scott Windon
Posted on February 20, 2022
Wanted a nice and simple PHP class which could generate random codes. After looking at multiple libraries I found that sometimes it's best done yourself.
The final class can either generate a single code or an array of codes based on the parameters you set.
https://github.com/swindon/code-generator
Example
Generates 8 character long string
(new CodeGenerator)->generate(8);
// output: 4CF9O7XP
Show some support!
💖 💪 🙅 🚩
Scott Windon
Posted on February 20, 2022
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.