Create a registration key

This simple function allows you to generate a random registration key in the format, ‘1224-54B1-7D35-5EF7’.

function registration_key()
{
    return strtoupper(substr(chunk_split(sprintf('%03d%s', 
                      rand(0,999), uniqid('')), 4, '-'), 0, -1));
}
Did you like this? Share it:

Leave a Reply