<?
require("config.ini.php");
$pageArray = array(
"http://us.php.net/manual/en/timezones.africa.php",
"http://us.php.net/manual/en/timezones.america.php",
"http://us.php.net/manual/en/timezones.antarctica.php",
"http://us.php.net/manual/en/timezones.arctic.php",
"http://us.php.net/manual/en/timezones.asia.php",
"http://us.php.net/manual/en/timezones.atlantic.php",
"http://us.php.net/manual/en/timezones.australia.php",
"http://us.php.net/manual/en/timezones.europe.php",
"http://us.php.net/manual/en/timezones.indian.php",
"http://us.php.net/manual/en/timezones.pacific.php",
"http://us.php.net/manual/en/timezones.others.php"
);
foreach($pageArray as $url)
{
$area = str_replace(".php","",str_replace("http://us.php.net/manual/en/timezones.","",$url));
if($debug == "true")
echo $area."<br>";
$fp = fopen($url,"r");
while($line = fgets($fp))
{
$country = subcontent($line,"<td align=\"left\">","</td>");
if($country != "" && $country != "empty\"> ")
{
if($debug == "true")
echo $country."<br>\n";
if(mysql_num_rows(mysql_query("select * from timezonetb where area = '$area' and country = '$country'"))==0)
{
$sql = "insert into timezonetb(area,country)values('$area','$country')";
mysql_query($sql,$link);
}
}
}
fclose($fp);
}
?> |