Yep, just realised that now...
If you run this script:
<?php
$servers = array("mars","venus","mercury");
$courses = array("AB1","AB2","AB3");
$quarters = array("Fall","Winter","Spring","SSI","SSII");
$years = array("2004","2005");
foreach($servers as $server) {
echo "<td>\n<table width='100%' border='0'>\n<tr>\n<th align='left'>$server</th>\n</tr>\n<tr><td>\n";
foreach($courses as $course) {
foreach($quarters as $quarter) {
foreach($years as $year) {
$url = "http://".$server.".ucdavis.edu/".$course."/".$quarter.$year."/Login/Login.cfm";
echo "<a href='$url'>$course $quarter $year</a><br/>\n";
}
}
}
echo "</td></tr>\n</table>\n</td>\n";
}
?>
It runs almost instantly.
Try running this script (php5):
<?php
$start = microtime(true);
@fopen("http://www.google.com", "r");
$end = microtime(true);
echo $end-$start;
?>
Now run this one:
<?php
$start = microtime(true);
@fopen("http://www.gdoogle.com", "r");
$end = microtime(true);
echo $end-$start;
?>
The script for google.com takes 0.15 on my pc. The script for an invalid url takes 11 seconds...
That's where the problem lies :-)
There are over ways to check URLs though, but all will take a while to validate any significant number of urls.
Cheers