function getElementsByClassName(\DOMDocument $DOMDocument, $ClassName) {
$Elements = $DOMDocument->getElementsByTagName("*");
$Matched = array();
for($i=0;$i<$Elements->length;$i++) {
if($Elements->item($i)->attributes->getNamedItem('class')->nodeValue == $ClassName) {
$Matched[]=$Elements->item($i);
}
}
return $Matched;
}