- var_dump: documentation ( source)
<?php
$s = '<p class="asdf" style="font-size: 12px;">ASDF</p>';
$dom1 = new DOMDocument();
$dom1->loadHTML($s);
$p = $dom1->getElementsByTagName('p');
for ($i=0; $i < $p->length; $i++) {
$attr = $p->item($i)->getAttribute('style');
var_dump($attr);
}