Tidy tidy_access_count
(PHP 5, PHP 7, PHP 8, PECL tidy >= 0.5.2)
tidy_access_count — 지정된 문서에 대해 발생한 Tidy 접근성 경고의 수를 반환합니다.
설명
tidy_access_count(tidy $tidy
): int
Tidy_access_count()는 지정된 문서에 대해 발견된 접근성 경고의 수를 반환합니다.
매개변수
tidy
- tidy 개체.
반환 값
경고 수를 반환합니다.
Examples
예제 #1 tidy_access_count() 예제
<?php
$html ='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html><head><title>Title</title></head>
<body>
<p><img src="img.png"></p>
</body></html>';
// select the accessibility check level: 1, 2 or 3
$config = array('accessibility-check' => 3);
$tidy = new tidy();
$tidy->parseString($html, $config);
$tidy->cleanRepair();
/* Never forget to call this! */
$tidy->diagnose();
echo tidy_access_count($tidy); //5
?>
메모
메모: TidyLib의 설계로 인해 Tidy_access_count()보다 먼저 tidy_diagnose()를 호출해야 합니다. 그렇지 않으면 항상 0
을 반환합니다. 또한 accessibility-check
옵션을 활성화해야 합니다.
기타
- tidy_error_count() - 지정된 문서에 대해 발생한 Tidy 오류의 수를 반환합니다.
- tidy_warning_count() - 지정된 문서에 대해 발생한 Tidy 경고의 수를 반환합니다.