• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • tidy::getStatus()

    (PHP 5, PHP 7, PECL tidy >= 0.5.2)

    获取指定文档的状态

    说明

    面向对象风格
    publictidy::getStatus(void): int
    过程化风格
    tidy_get_status(tidy$object): int

    参数

    • $object:Tidy对象。

    返回值

    如果未引发错误/警告,则返回0;对于警告或辅助功能错误,返回1;对于错误,返回2。

    范例

    <?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
    ?>
    

    上篇:tidy::getRelease()

    下篇:tidy::head()