I suspect this part:
I am trying to extract all headings from my website, I wrote the get_heading function and added this to my script - sometimes it returns data and other times it takes too long....
Any ideas???
$heading = get_heading($SITE1, "<h1(.*)h1>");
print "My Headings $heading";
function get_heading($site_scan, $pat) {
global $text2remove;
$file123 = fopen ("$site_scan", "r");
//print "file123: $file123<br>";
//$file123 = implode("\n", $file123);
while (!feof ($file123)) {
$line = fgets ($file123, 1024);
$line_all = $line_all." ".$line;
// print "line is: $line<br>";
// $line1 = explode("\n", $line);
// print "show array on line1<br>";
// show_array($line1);
}
//print "line_all is:<br> $line_all<br>";
if (eregi ($pat, $line_all, $out)) {
$var_item = $out[1];
// $var_item = implode("\n", $var_item);
$var_item = eregi_replace($text2remove, " ",$var_item);
// $var_item = eregi_replace(array("-|_|",","), array(" ",""),$var_item);
$var_item_stripped = $var_item." ".$var_item_stripped;
$var_item_stripped = trim($var_item_stripped);
}
// print "line1 is: <b>$line1</b><br>";
// print "line is: <b>$line</b><br>";
return $var_item_stripped;
}