lundi 29 février 2016

php - Randomization - srand offset

I want to randomize number using given seed and offset. In other words, I look for the correct way do do the following:

function get_random($seed, $offset) {
  srand($seed);
  for ($i = 0; $i < $offset; $i++) {
    rand();
  }
  return rand();
}




Aucun commentaire:

Enregistrer un commentaire