I’m using file() to read in the source of a web page and then search for a particular tag. My confusion is because of the following:
$page = file(www.example.com);
foreach ($page as $line_num => $line)
{
if ($line == "<div class="papaya">")
{
echo"Found it!!!!!";
}
}
Which doesn’t work.
As a test I tried just searching for a simpler tag in case the extra " were causing a problem due to not being escaped, but that doesn’t work either.
I’ve also run through $page to see if each $line does contain a string with $is_string() and that all seems ok.
I am stumped as to what I am doing wrong.