]*\s+href\s*=\s*["\']?(http://[^"\'\#\s>]*)#i', $cont['content'], $base);
$curl = make_url( (empty($base[1]) ? $url : $base[1]) , $sub);
if( !preg_match('#^https?://[^/]*'.str_replace('.','\.',SITE).'/[^\#]*#i', $curl) )
continue;
if( !in_array($curl ,$urls ) ){
crawl($curl);
}
}
}
/*echo anything for debuging output*/
function _echo($val){
echo "
";
if(is_array($val) || is_object($val)) $val = var_export($val,1);
elseif(is_file($val)) $val = file_get_contents($val);
elseif(empty($val)) $val = "nothing to echo";
echo htmlspecialchars($val);
echo "
";
}
function _error($msg, $title='NOTICE'){
echo "{$title}: {$msg}
";
}
function _time()
{
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
}
function _mem() {
if(function_exists("memory_get_peak_usage")) {
$mem = memory_get_peak_usage(true);
} else if(function_exists("memory_get_usage")) {
$mem = memory_get_usage(true);
}else
return false;
return round($mem / 1024 / 1024,2);
}
?>