Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works

How to generate unique key of random numbers in PHP

  • Please log in to reply

Aarav Bisht

Aarav Bisht

    New Member

  • Member
  • Pip
  • 5 posts

Hi, I am looking for some example code that can help me to generate unique random string of numeric numbers in PHP Applications. I am hoping to resolve this issue with the help of tech developers working around & for this I have researched for many php questions & answers in various forums, but didn't get any satisfactory response. Hoping to get answer here.

Edited by admin, 17 October 2016 - 01:22 PM.
removed spam link

  • 0





  • Member
  • PipPipPip
  • 401 posts
Are you caching the "unqiue" string or storing it in a database?

You could build a random string generator. I'm not really a php guys, but here is an example


If it's going to be saved in a db, I would have your code to check to see if your random code exists.. if it does, regenerate else accept random string.
  • 0

Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP