srand((float) microtime() * 10000000);

Discussion in 'PHP' started by x0x, Oct 4, 2009.

  1. #1
    I found things like:

    srand((float) microtime() * 10000000);


    srand(microtime()*time());


    In my script... I don't understand what they are for. No variable uses them, they are just there like that. What do you think?
     
    x0x, Oct 4, 2009 IP
  2. lmao

    lmao Guest

    Messages:
    93
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    this srand function Seeds the random number generator with seed here seed is (float) microtime() * 10000000 and microtime()*time() srand is used prior to calling rand function so what srand does is that so rand function can get more random no
     
    lmao, Oct 4, 2009 IP
  3. kbluhm

    kbluhm Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    From http://www.php.net/srand:
     
    kbluhm, Oct 4, 2009 IP
  4. toonboon

    toonboon Peon

    Messages:
    20
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Which would imply that the script you are using is written for a very old version of PHP and might need checking to ensure there are no bugs or other flaws.
     
    toonboon, Oct 4, 2009 IP