I want to generate test data for testing. What I need:
I will have a list of 30 names. For each name I need to fill in the start and finish position. The position is between 1 and 30.
So I wanted to use RAND() in php but I have a problem what I can’t find a good way for.
Every position can only be used once. So if I press on a button “generate data” I want for all 30 names a start and finish position without duplicate position. So in the start i will use 1 – 30 and for the finish 1 – 30 as well.
I need this data in textfield. Is there a simple function for this? Or do you know how I can do this without having to fill in 60 textfields every test.
I will use shuffle (twice),
something like
if you have already array with the names
you can use this function
Very simple shuffle function preserving key with value