<?php
tidy_parse_file('test.html');
$body = tidy_get_body();
foreach($body->attributes() as $attr) {
if($attr->id == TIDY_ATTR_BGCOLOR) {
echo "The background color is: '{$attr->value}'";
}
}
?>
<?php
tidy_parse_file('test.html');
$body = tidy_get_body();
$attr = $body->get_attr(TIDY_ATTR_BGCOLOR);
echo "The background color is: '{$attr->value}'";
?>