Create a registration key

Last modified date

Comments: 0

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.