5

I have an array of over 1000s keys in PHP which I want to randomize. I am currently using shuffle to do this, however I want the shuffled order to be the same everytime. So, random but always in the same random order everytime the script is ran.

It's a client request :). Randomize, but keep it the same random order everytime.

2
  • Call it psudo random then. He descibes exactly what he needs and your comment is pointless Commented Dec 21, 2012 at 11:44
  • Ask which random he likes most and then change seed number Commented Dec 21, 2012 at 11:47

1 Answer 1

2

Call srand(int seed) first, with a constant. e.g. srand(123).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.