php open modify and save html file
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.".xhtml" ); $xpath = new DOMXPath( $dom ); $pDivs = $xpath->query(".//div[@class='Areas']"); foreach ( $pDivs as $div ) { $div->parentNode->removeChild( $div ); } echo htmlspecialchars($dom->saveHTMLFile()); It doesn't work... My html file look : <html> <head> <title></title> <link href="css.css" rel="stylesheet" type="text/css" /> </head> <body> <div style="height:998px;"> <img src="images/bg004.jpg" /> <div class="class1"> <div class=