• 首页
  • vue
  • TypeScript
  • JavaScript
  • scss
  • css3
  • html5
  • php
  • MySQL
  • redis
  • jQuery
  • tidy_access_count()

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

    返回指定文档遇到的Tidy功能警告数

    说明

    tidy_access_count(tidy$object): int

    参数

    • $object:The Tidy对象。

    返回值

    返回警告个数

    范例

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

    注释

    Note:

    Due to the design of the TidyLib, you must call tidy_diagnose() before tidy_access_count() or it will return always0. You must also need to enable theaccessibility-checkoption.

    参见