SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    May 2004
    Location
    Planet Earth
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Repeat a function multiple times

    Hi!

    How can I repeat a function 1000 times?

    I have an script that creates random numbers but one at a time. How can I tell the function to do it a 1000 times?

    Like for example $random_generator .=rand(1,10000);

    Thanks for any help
    "The Internet ? Is that thing still around ?"

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    first up - why on earth would you want to run a function 1000 times?!

    PHP Code:
    for($i=0;$i<=999;$i++) {
    // call function

    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Zealot
    Join Date
    May 2004
    Location
    Planet Earth
    Posts
    136
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    haha thanks SpikeZ, I donīt know why I wanted to run the function so many times haha. I thought that way it will display the results that number of times.

    Thanks a 1000 times for your help
    "The Internet ? Is that thing still around ?"

  4. #4
    SitePoint Wizard silver trophybronze trophy Cups's Avatar
    Join Date
    Oct 2006
    Location
    France, deep rural.
    Posts
    6,869
    Mentioned
    17 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by plasmahba
    Thanks a 1000 times for your help
    Given the subject, didn't you mean
    PHP Code:
    for($i=0;$i<=999;$i++) {
    echo 
    'Thanks for your help' 


  5. #5
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,807
    Mentioned
    158 Post(s)
    Tagged
    3 Thread(s)
    lol
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •