Hi all,
I'm trying to browse through the code of a website (for this case example.com), and return different messages if certain text matches something in the code (in this case "You").
Here is my code:
<?php
$html = implode('', file('http://www.example.com/'));
preg_match_all('/You/',$html, $result);
$answer = implode(' ', $result);
if (preg_match("/You/", $answer)) {
echo "A match was found.";
} else {
echo "A match was not found.";
}
?>
Even though "You" is contained in the page, I get the message "A match was not found.". Does anyone know the solution for this?
Thanks very much,
Michael