Unique identification string in php

Posted by NardCake on Stack Overflow See other posts from Stack Overflow or by NardCake
Published on 2012-09-22T15:33:00Z Indexed on 2012/09/22 15:37 UTC
Read the original article Hit count: 157

Filed under:

Currently me and my friend are developing a website, for what we will call 'projects' we just have a basic auto increment id in the database used to navigate to projects such as

oururl.com/viewproject?id=1

but we started thinking, if we have alot of posted projects thats going to be a LONG url. So we need to somehow randomly generate a alphanumerical string about 6 characters long. We want the chance of the string being duplicated being extremely low and of course we will query the database before assigning an identifier. Thanks for anyhelp, means alot!

© Stack Overflow or respective owner

Related posts about php