By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,614 Members | 1,662 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,614 IT Pros & Developers. It's quick & easy.

May i use Rand Function without query

P: 32

i have question to all. may i use rand function in php without query, and how can i use rand function for display data.

if and one have any idea about it help me.
Feb 19 '08 #1
Share this Question
Share on Google+
1 Reply

Expert 100+
P: 490
you would like to out put a random number in PHP?

Expand|Select|Wrap|Line Numbers
  1. srand(time());
  2. $rndString = (rand()%9) . (rand()%9) . (rand()%9) . (rand()%9);
generates a four digit random number. the first line makes sure the number is truely random!
Feb 19 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.