Tidy tidy_error_count
(PHP 5, PHP 7, PHP 8, PECL tidy >= 0.5.2)
tidy_error_count — 지정된 문서에 대해 발생한 Tidy 오류의 수를 반환합니다.
설명
tidy_error_count(tidy $tidy
): int
지정된 문서에 대해 발생한 Tidy 오류 수를 반환합니다.
매개변수
tidy
- tidy 개체.
반환 값
오류 수를 반환합니다.
Examples
예제 #1 tidy_error_count() 예제
<?php
$html = '<p>test</i>
<bogustag>bogus</bogustag>';
$tidy = tidy_parse_string($html);
echo tidy_error_count($tidy) . "\n"; //1
echo $tidy->errorBuffer;
?>
위의 예는 다음을 출력합니다.
1 line 1 column 1 - Warning: missing <!DOCTYPE> declaration line 1 column 8 - Warning: discarding unexpected </i> line 2 column 1 - Error: <bogustag> is not recognized! line 2 column 1 - Warning: discarding unexpected <bogustag> line 2 column 16 - Warning: discarding unexpected </bogustag> line 1 column 1 - Warning: inserting missing 'title' element
기타
- tidy_access_count() - 지정된 문서에 대해 발생한 깔끔한 접근성 경고의 수를 반환합니다.
- tidy_warning_count() - 지정된 문서에 대해 발생한 Tidy 경고의 수를 반환합니다.