May i use Rand Function without query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rahia307
    New Member
    • Jun 2007
    • 32

    May i use Rand Function without query

    Hi

    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.
  • harshmaul
    Recognized Expert Contributor
    • Jul 2007
    • 490

    #2
    you would like to out put a random number in PHP?

    Code:
    srand(time());
    $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!

    Comment

    Working...