User:Cakemix/Snippets/PHP/Generate Serial

Input:

$chr = "123456789ABCDEFGHIJKLMNOPQRSTUVWX"; $s = "XXXXX-"; for ($is = 0; $is < 4; $is++): for ($p = 0; $p < 5; $p++): $s .= $chr[mt_rand(1, strlen($chr) - 1)]; endfor; if ($is != 3): $s .= "-"; endif; endfor; echo $s;

Output:

XXXXX-D9B3V-QF98H-OIXKB-CE89M