Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Jul 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts

    looping parts of a function

    Hi all

    I have a function that queries URLS for certain keywords, but at present it stops after the first 10

    I want it to be able to carry on for as many as i require

    so lets say 1000

    $start is the variable that denotes the starting point

    How do i get it to loop, so that it keeps doing it for

    $start =10 then 20 etc right up to 1000

    the function is


    function query($topic, $start = 0)

    {
    $googlelist = $this->_query("Google", $topic, $start);
    $yahoolist = $this->_query("Yahoo", $topic, $start);
    $this->found = array_unique(array_merge($googlelist, $yahoolist));
    $this->counts = array("yahoo" => count($yahoolist), "google"=> count($googlelist), "total" => count($this->found));
    return true;
    }

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Try a for loop.

  • #3
    New Coder
    Join Date
    Jul 2006
    Posts
    14
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Tried that but didnt work

    still stopped at 10


  •  

    Posting Permissions

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