Hey guys, I'm newbie here and I know very little about php. I want to ask for your help, please.
I'm trying to built a php script that parses www.google.com and www.yahoo.com and checks the source for <a href="http://www.google.com/ncr and than to notify me where my code is missing.
This is all I have for now and I don't know what to do next :), also I'm not sure if my regex is correct.
<?php
echo nl2br ("a href checker\n\n");
$pages = array(
"http://www.google.com",
"http://www.yahoo.com");
foreach($pages as $page)
file_get_contents('$page');
$regex = '!a href=\"http://www.google.com/ncr\"!smiU';
if (preg_match("$regex", "$pagina")) {
echo "Found a href.";
} else {
echo nl2br ("a href not found on %site%");
}
?>
I really need some hints, since I'm stuck.
Thank you very much,