I have an html string
$html_string = '<div style="font-family:comic sans ms,cursive;">
<div style="font-size:200%;">Some Text </div></div>';
I have tried
$dom = new DOMDocument;
$dom->loadHTML($html_string);
$divs = $dom->getElementsByTagName('div');
for($i=0;$i<$divs->length;$i++) {
$attrib = $divs->item($i)->getAttribute("style");
echo $attrib;
echo '<br />';
}
it gives the following output
font-family:comic sans ms,cursive
font-size:200%;
I need
font-family
font-size
How can I get only these keys not the values they have?