/","",$file);
preg_replace("/\"(.+?)\"/se","add_link(\"\\0\")",$file);
}
function hanki_pelkka_path($www) {
if (preg_match("/\\/$/",$www)) return $www;
$www = preg_replace("/^(.*)\\/(.+?)$/","\\1/",$www);
return $www;
}
function add_link($www) {
global $links, $alkup;
$www = str_replace("\"","",$www);
// Sopiva linkki?
if (preg_match("/^(http|https|ftp):\\/\\//",$www)) { $sopii = true; }
elseif (preg_match("/(html|php|\\/)$/",$www)) { $sopii = true; $www = hanki_pelkka_path($alkup).$www; }
else { return ''; }
$links[] = $www;
}
$links[] = "http://localhost/frozenblog/";
$i = 0;
while ($i <= count($links) AND $try < 10) {
$link = $links[$i];
print "Parseroidaan linkkiƤ $link (I: $i) \n
";
parse_page($link);
$i++;
}
print_r($links);
?>