View Full Version : looping parts of a function

01-26-2007, 11:22 AM
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;

01-26-2007, 06:12 PM
Try a for loop (http://us2.php.net/manual/en/control-structures.for.php).

01-26-2007, 06:34 PM
Tried that but didnt work

still stopped at 10