tidy::$errorBuffer()

获取当前 Tidy 对象的错误信息缓冲区

首字母:T

函数名称:tidy::$errorBuffer()

适用版本:PHP 5, PHP 7

函数说明:tidy::$errorBuffer() 函数用于获取当前 Tidy 对象的错误信息缓冲区。

语法:string tidy::$errorBuffer()

参数:无

返回值:返回一个包含当前 Tidy 对象错误信息的字符串。

示例:

// 创建一个 Tidy 对象
$tidy = new tidy();
// 设置输入HTML
$html = "Test

Hello, World!

"; $tidy->parseString($html); // 检查是否有错误 if ($tidy->errorBuffer()) { echo "Tidy 发生了以下错误:
"; echo $tidy->errorBuffer(); } else { echo "HTML 代码没有错误。"; }

输出:

Tidy 发生了以下错误:
line 1 column 6 - Warning: missing  declaration
line 1 column 6 - Warning: inserting missing 'title' element
line 1 column 6 - Warning: inserting implicit 
line 1 column 6 - Warning: inserting implicit 
line 1 column 6 - Warning: trimming empty 
</code></pre>
<p>注意事项:</p>
<ul>
<li>在调用 <code>tidy::parseString()</code> 或 <code>tidy::parseFile()</code> 之后,可以通过 <code>tidy::$errorBuffer()</code> 获取错误信息。</li>
<li>如果没有发生错误,则返回的字符串为空。</li>
<li>错误信息的格式为行号、列号、错误级别和错误消息。</li>
<li>可以根据错误信息来修复 HTML 代码中的问题。</li>
</ul>    </section>

    <nav class="fn-nav" aria-label="上下篇">
              <a class="fn-prev" href="/php-han-shu-da-quan/7627.html">
          <i class="fa-solid fa-angle-left"></i>
          <span>上一个:tidy::body()</span>
        </a>
                    <a class="fn-next" href="/php-han-shu-da-quan/7629.html">
          <span>下一个:Throwable::__toString()</span>
          <i class="fa-solid fa-angle-right"></i>
        </a>
          </nav>

          <section class="art-section">
        <h2>同首字母函数</h2>
        <div class="fn-related">
                      <a class="fn-rel-card" href="/php-han-shu-da-quan/7563.html">
              <span class="fn-rel-name">Table::count()</span>
              <span class="fn-rel-purpose">返回Table类的实例中的行数</span>
            </a>
                      <a class="fn-rel-card" href="/php-han-shu-da-quan/7575.html">
              <span class="fn-rel-name">TableInsert::values()</span>
              <span class="fn-rel-purpose">向数据库表中插入数据</span>
            </a>
                      <a class="fn-rel-card" href="/php-han-shu-da-quan/7576.html">
              <span class="fn-rel-name">TableDelete::where()</span>
              <span class="fn-rel-purpose">在数据库表中执行删除操作时添加条件</span>
            </a>
                      <a class="fn-rel-card" href="/php-han-shu-da-quan/7577.html">
              <span class="fn-rel-name">TableDelete::__construct()</span>
              <span class="fn-rel-purpose">创建一个新的 TableDelete 对象,该对象用于执行数据库表的删除操作</span>
            </a>
                      <a class="fn-rel-card" href="/php-han-shu-da-quan/7578.html">
              <span class="fn-rel-name">TableDelete::orderby()</span>
              <span class="fn-rel-purpose">指定删除表数据时的排序规则</span>
            </a>
                      <a class="fn-rel-card" href="/php-han-shu-da-quan/7579.html">
              <span class="fn-rel-name">TableDelete::limit()</span>
              <span class="fn-rel-purpose">限制删除操作的方法</span>
            </a>
                      <a class="fn-rel-card" href="/php-han-shu-da-quan/7580.html">
              <span class="fn-rel-name">TableDelete::execute()</span>
              <span class="fn-rel-purpose">执行数据库表的删除操作</span>
            </a>
                      <a class="fn-rel-card" href="/php-han-shu-da-quan/7581.html">
              <span class="fn-rel-name">Table::__construct()</span>
              <span class="fn-rel-purpose">当创建Table对象时,该构造函数会被自动调用</span>
            </a>
                      <a class="fn-rel-card" href="/php-han-shu-da-quan/7582.html">
              <span class="fn-rel-name">Table::update()</span>
              <span class="fn-rel-purpose">更新表中的行</span>
            </a>
                      <a class="fn-rel-card" href="/php-han-shu-da-quan/7583.html">
              <span class="fn-rel-name">Table::select()</span>
              <span class="fn-rel-purpose">从数据库中选择数据</span>
            </a>
                      <a class="fn-rel-card" href="/php-han-shu-da-quan/7584.html">
              <span class="fn-rel-name">TableDelete::bind()</span>
              <span class="fn-rel-purpose">绑定删除查询参数</span>
            </a>
                      <a class="fn-rel-card" href="/php-han-shu-da-quan/7585.html">
              <span class="fn-rel-name">Table::isView()</span>
              <span class="fn-rel-purpose">检查表是否为视图</span>
            </a>
                  </div>
      </section>
      </article>
  <footer class="foot">
    <p>众里寻他千百度,你要的都在千寻网</p>
    <p>© 2026 千寻网 · <a href="https://beian.miit.gov.cn/" target="_blank" rel="nofollow noopener">浙ICP备2025198649号-3</a></p>
  </footer>
<script src="/static/js/core/jquery.min.js"></script>
<script src="/static/layer/layer.js"></script>
<script src="/static/js/theme.js"></script>
<div class="float-bar" id="floatBar" data-url="/php-han-shu-da-quan/7628.html">
  <a class="fb-btn" href="/" title="返回首页"><i class="fa-solid fa-house"></i></a>
  <button class="fb-btn" id="fbLike" title="点赞支持"><i class="fa-regular fa-thumbs-up"></i></button>
  <button class="fb-btn" id="fbFav" title="收藏"><i class="fa-regular fa-star"></i></button>
  <a class="fb-btn" href="/favorites/" title="我的收藏"><i class="fa-solid fa-bookmark"></i></a>
  <button class="fb-btn fb-top" id="fbTop" title="返回顶部"><i class="fa-solid fa-arrow-up"></i></button>
</div>
<script src="/static/js/float.js"></script><script>
$(function(){
  $('#menuToggle').on('click', function(){ $('body').toggleClass('nav-open'); });
  $('#overlay').on('click', function(){ $('body').removeClass('nav-open'); });
});
</script>
</main>
</body>
</html>