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

Link to comment
Share on other sites

  • 4 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.