(PHP 5, PHP 7, PHP 8, PECL tidy >= 0.5.2)
tidy::getStatus -- tidy_get_status — 取得指定文件的狀態
若沒有發生錯誤/警告,則返回 0;若有警告或無障礙錯誤,則返回 1;若有錯誤,則返回 2。
範例 #1 tidy::getStatus() 範例
<?php
$html = '<p>paragraph</i>';
$tidy = new tidy();
$tidy->parseString($html);
$tidy2 = new tidy();
$html2 = '<bogus>test</bogus>';
$tidy2->parseString($html2);
echo $tidy->getStatus(); //1
echo $tidy2->getStatus(); //2
?>