<?php
$html = '<div>Ora que raio!</div>
<p>Ola meu nome é pseudomatica (sou normal), etc. Meu nome é assim pq sim</p>
<div class="minhaClasse">Encontrei</div>
<p></p>';
$dom = new DOMDocument;
$dom->loadHTML($html);
$class = 'minhaClasse';
$procura = new DomXPath($dom);
$div = $procura->query("//*[contains(@class, '$class')]");
PD9waHAKCiRodG1sID0gJzxkaXY+T3JhIHF1ZSByYWlvITwvZGl2Pgo8cD5PbGEgbWV1IG5vbWUgw6kgcHNldWRvbWF0aWNhIChzb3Ugbm9ybWFsKSwgZXRjLiBNZXUgbm9tZSDDqSBhc3NpbSBwcSBzaW08L3A+CjxkaXYgY2xhc3M9Im1pbmhhQ2xhc3NlIj5FbmNvbnRyZWk8L2Rpdj4KPHA+PC9wPic7CgokZG9tID0gbmV3IERPTURvY3VtZW50OwokZG9tLT5sb2FkSFRNTCgkaHRtbCk7CgokY2xhc3MgPSAnbWluaGFDbGFzc2UnOwoKJHByb2N1cmEgPSBuZXcgRG9tWFBhdGgoJGRvbSk7CgokZGl2ID0gJHByb2N1cmEtPnF1ZXJ5KCIvLypbY29udGFpbnMoQGNsYXNzLCAnJGNsYXNzJyldIik7Cgp2YXJfZHVtcCgkZGl2LT5pdGVtKDApLT5ub2RlVmFsdWUpOw==