I have never played with a simple HTML parser, but I'm a pretty big fan of the built-in SimpleXML PHP. It does the same.
$XML = simplexml_load_string(file_get_contents('test_doc.html'));
$all_labels = $XML->xpath("//td[@class='label']");
$all_datainfo = $XML->xpath("//div[@class='datainfo']");
$all = array_combine($all_labels,$all_datainfo);
foreach($all as $k=>$v) { $final[preg_replace('/:$/', '', (string)$k)] = (string)$v; }
print_r($final);
, (string), print_r $all.
:
Array
(
[Name] => Stuff
[Email] => Stuff2
[Address] => Stuff3
[Field1] => MoreStuff
[Field2] => MoreStuff2
[Field3] => MoreStuff3
)