I\'ve got a string with HTML attributes:
$attribs = \' id= \"header \" class = \"foo bar\" style =\"background-color:#fff; color: red; \"\';
Use SimpleXML:
"); print_r($x); ?>
This assumes that the attributes are always name/value pairs...