<?php

$html = <<<EOF
<html>
<p>some random text</p>

<div class="greybackground_desktop" style="background-color:#EFEFEF;">
<!-- /49527960/CSF_Article_Middle -->
<div style="padding-bottom:10px; padding-top: 10px; text-align:center;" id='div-gpt-ad-1441883689230-0'>
<script type='text/javascript'>
googletag.cmd.push(function() { googletag.display('div-gpt-ad-1441883689230-0'); });
</script>
</div>
</div>

<p>some more text</p>

<div><p>example of content that will be incorrectly removed</p></div>

<p>Text that follows</p>
</html>
EOF;

$dom = new DOMDocument();
$dom->loadHTML($html);

$xpath = new DOMXpath($dom);

foreach ($xpath->query("//div[@class='greybackground_desktop']") as $div)
	$div->parentNode->removeChild($div);

echo $dom->saveHTML();

?>