I'm having some awful problems with my code:
...
//process again but with emails
for($o = 0; $o < sizeof($linkarray[0]); $o++){
$emailf = $linkarray[1][$o];
function parse_emails($emailf) {
# Zero or more whitespace characters
$S0 = '\s*';
# One or more whitespace characters
$S1 = '\s+';
# Anchor tag start
$anch1 = '<a' . $S1 . '.*';
#Space between
# href= pattern
$href1 = 'href' . $S0 . '=' . $S0;
# quoted strings, with selection
$q1 = "'[^']'";
$q2 = '"[^"]*"';
$q = "($q1|$q2)";
# full link pattern
$link_RE = "$anch1$S0$href1$q$S0>\s*(.*?)</a>";
//global $q, $href1, $link_RE;
preg_match_all("#$link_RE#i", $linkarray[1][$o], $matches);
return $matches; // returns an array
} // end function parse_links()
//
// DEMO OF HOW TO USE THE FUNCTION
// grab a webpage
$str = implode('',file("$emailf"));
// call the parse_links function
$linkarray=parse_emails($str);
echo "Relevent links found to backlink:<br><br>";
// loop through the link array, outputting the URL + Link Text
for ($i = 0; $i < sizeof($linkarray[0]); $i++){
echo ($linkarray[2][$o] . " - <a href=" . $linkarray[1][$o] . "> Link " . $o . "</a><br>");
}
echo "<br><br>";
}
?>
I get the error message:
Warning: file("http://www.mentorfoundation.org/vx/car.html"): failed to open stream: No such file or directory in /home/hydropow/public_html/webmaster.php on line 142
Warning: implode(): Bad arguments. in /home/hydropow/public_html/webmaster.php on line 142
The site should be parsed, why does it say it can't? Any help will be appreciated.
Thanks,
Lee.