License Key Generator Php

Active1 year, 7 months ago
  1. Reimage License Key Generator
  2. Free License Key Generator
  3. License Key Generator Free Download

I want to have a random serial created on my website everytime someone visits.

License key generator free download - Mirrakey License Key Generator, Serial Key Generator, CD Key Generator, and many more programs.

The format of the serial should be XXXXX-XXXXX-XXXXX-XXXXX.

X represents a random number or capital letter.
Unfortunately I have no idea how to do this. Could anybody please help me out?

So for example the random serial output could be: 3WT4A-NB34O-JU87P-B3UHS
Thanks a lot!

kuba
6,4841 gold badge26 silver badges40 bronze badges
Kid DiamondKid Diamond
6046 gold badges22 silver badges60 bronze badges

7 Answers

There are most certainly better ways of doing it, but this is the first that jumps to mind:

05/26/13 Edit: It's advised to keep the Count function outside of the loop. The reason for this is that you don't want to expend the extra clock cycles running this function through each iteration when you can simply run it once.

maiorano84maiorano84
9,4803 gold badges25 silver badges42 bronze badges

Another approach is to calculate the four segments as random numbers in base 36.

Licensesalathesalathe
45k10 gold badges92 silver badges121 bronze badges

Reimage License Key Generator

The most straightforward solution would be something like this.

Sample output:

blafratblafrat

There's a bunch of ways to approach this. One simple one is:

There are better ways to generate random strings then this but this would give you the basic functionality you're looking for.

John CondeJohn Conde
191k84 gold badges383 silver badges436 bronze badges
Moyed AnsariMoyed Ansari
7,7582 gold badges29 silver badges52 bronze badges

If you want to use this serial just because of uniqueness - you could also try to use UUID v4, as described in one of answers here: PHP function to generate v4 UUID

Community
LaimoncijusLaimoncijus
5,2028 gold badges50 silver badges78 bronze badges

There a lot of such answers at SO: https://stackoverflow.com/a/4356295/1091195

You can use the random string generator mentioned there, either you use it once to get a 20 letter string then insert dashes, or you can call it 4 times for 5 letter and concat the results.

Free License Key Generator

Php
Community
kubakuba

License Key Generator Free Download

6,4841 gold badge26 silver badges40 bronze badges

Not the answer you're looking for? Browse other questions tagged php or ask your own question.