<?php

$buffer = '<html></html>';
$config = array('doctype' => 'php');
$tidy = tidy_parse_string($buffer, $config);
var_dump(tidy_config_count($tidy));
Exemple #2
0
	$tidy->parseString($pre.$row->NOTES.$post, $config, 'utf8');
	if ((tidy_error_count($tidy) >= 0 || tidy_warning_count($tidy) >= 0) && $row->NOTES != '') { //  && $t == 1
//	if ($row->NOTES != '') {
		print "<tr><td>".$row->NOTES."</td><td>"; // <br /><hr /><br />\n\n";

		print "update catalogue_bznew set notes='".$db_blo->escape(trim(tidy_repair_string($pre.$row->NOTES.$post, $config, "utf8")))."' WHERE id = '{$row->id}'"."</td><td>"; // ."<br /><hr /><br />\n\n";
//		print htmlentities($row->NOTES)."<br /><hr /><br />";
//		print htmlentities(trim(tidy_repair_string($row->NOTES, $config, "utf8")));
		$error = $tidy->errorBuffer;
//		if ($error !== "line 1 column 1 - Warning: inserting missing 'title' element" && $error != '') {
/*
		&& $error !== "line 1 column 1 - Warning: missing <!DOCTYPE> declaration
line 1 column 1 - Warning: plain text isn't allowed in <head> elements
line 1 column 1 - Warning: inserting missing 'title' element"
*/
			print "<td>".tidy_config_count($tidy).':'.$row->id.$row->TITLE_THIS;
			print " failed"."</td><td>";
			print $error.htmlentities($tidy->errorBuffer)."</pre>\n\n"."</td></tr>"; // <pre>
//			break;
			$t++;
//		}
		
//		break;
	}
	elseif (tidy_error_count($tidy) > 0) {
		$t++;
	}
	// print tidy_is_xhtml($tidy)."<br />";
} // end foreach
print "</table>";
print $t;