jeudi 30 septembre 2021

How can I generate a random with time interval in PHP

I have the code :

$length = 16;
$characters = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
$randomString = '';
for ($i = 0; $i < $length; $i++) {
   $randomString .= $characters[rand(0, strlen($characters) - 1)];
}
$key = $randomString;

How to solve this if the string will be shuffled after 10 minutes, and the string is always the same every 10 minutes?




Aucun commentaire:

Enregistrer un commentaire