\n"; foreach ($dirs as $dir) { echo "".$dir.""; $query = get_data($dir); preg_match_all("/(.*?)<\/a>/is", $query, $links); $newrows = array(); for ($index = 1; $index < sizeof($links[0]); $index++) { $newrows[] = array($links[1][$index], preg_replace("/\s+/", " ", trim(strip_tags($links[2][$index])))); } $new = 0; $old = 0; foreach ($newrows as $row) { $url = $row[0]; $title = $row[1]; $ext = pathinfo($url, PATHINFO_EXTENSION); if (!in_array($ext, $bad_ext)) { if (!$r_query[$url]) { $found[] = array($title.'.'.$ext, $url); $new++; } else { $old++; } } } echo "Found new: ".$new.", old: ".$old."\n"; } echo "\n"; if (sizeof($found) > 0) { echo "

New files:

"; } foreach ($found as $row) { echo "
".$row[0]."
\n"; } echo "
\n"; ?>