Jump to content

[HELP] Got a random number generator... would like some advanced tweaks


deviss

Recommended Posts

Hello

 

I've got a php script that generates random number every page refresh

 

<?php
srand ((double) microtime( )*1000000);
$random_number = rand(1000,5000);
echo "$random_number";
?>

 

I would like some advanced things...

 

first of all i don't want the random number to be generated every page refresh

I would like something like... based on pc hour

 

example:

 

- between 12 AM and 5 AM it will generate a number from 500 to 1000 randomly but the number should change also to a determined time i set such as every 5 minutes and not everytime i refresh the website page

- betweem 5 AM -  2 PM will generate a number from 3500 to 8000 and this number will change every 5 minutes too with one that exists between this interval

- and so on

 

 

Would appreciate if someone could help me with that

 

 

Thanks in advance

  • 4 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.