I want to execute some code if a div has an image inside, but can’t correctly complete the first line
(I think other lines are ok):
$page = index.php; // should be my homepage
$content = $page->find('div[id=sky]', 0)->innertext;
if($content == '<img src="img/water.png">'){
//do something
}
If you are trying to use the Simple HTML DOM Parser, as it looks like, you need to initialize it.
UPDATE: You of course need to download (Download Simple HTML DOM Parser), unpack, upload it to your server and the finally include it to have access to those functions.