PHP DOM Agregar clase al elemento
$dom = new DOMDocument;
$dom->loadHTML($html);
$divs = $dom->getElementsByTagName('div');
foreach ($divs as $div) {
$div->setAttribute('class', $div->getAttribute('class').' myclass');
}
$html = $dom->saveHTML();
Homeless Hoopoe