in php I would like to open a html file, delete the content of the div(class Areas) and save it.
$dom = new DOMDocument; $dom->loadHTMLFile( \"temp/page\".$y.
You want to remove the divs with class Area, so simply change the XPath query:
Area
$pDivs = $xpath->query(".//div[@class='Area']"); // not 'Areas'
And of course you will also need to do something with the results, for example:
echo htmlspecialchars($dom->saveHTML()); // prints the result