preg_match_all missing results

I am using preg_match_all in a loop to capture data from numerous documents. There are 12 items being captured per page, but starting on page 5 it only captures 11 results. But if i run the script only on page 5 it returns all 12 results. There are no errors or warnings being generated, so I am clueless. Please help!

[php] for ($i = 0; $i <= $pages; $i++) {
shell_exec(" /usr/local/bin/curl -o /tmp/coffee_process_ajax.tmp -b PHPSESSID=$cookie -d “category_id=$cat&page_index=$i” http://www…com/html/results_ajax.php");
$filename = “/tmp/coffee_process_ajax.tmp”;
$handle = fopen($filename, “r”);
$adata = fread($handle, filesize($filename));
fclose($handle);
preg_match_all("/

(.*?)</table>/", str_replace("\n","",$adata), $ajarray);
$saveThis[]=$ajarray[0];
}[/php]

PHP Version 5.2.11

Sponsor our Newsletter | Privacy Policy | Terms of Service