首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

tidy_error_count

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

tidy_error_count - 返回指定文档遇到的Tidy错误的数量

描述

代码语言:javascript
复制
int tidy_error_count ( tidy $object )

返回指定文档遇到的Tidy错误的数量。

参数

object

整洁的对象。

返回值

返回错误的数量。

例子

Example #1 tidy_error_count() example

代码语言:javascript
复制
<?php
$html?=?'<p>test</i>
<bogustag>bogus</bogustag>';

$tidy?=?tidy_parse_string($html);

echo?tidy_error_count($tidy)?.?"\n";?//1

echo?$tidy->errorBuffer;
?>

上面的例子将输出:

代码语言:javascript
复制
1
line 1 column 1 - Warning: missing <!DOCTYPE> declaration
line 1 column 8 - Warning: discarding unexpected </i>
line 2 column 1 - Error: <bogustag> is not recognized!
line 2 column 1 - Warning: discarding unexpected <bogustag>
line 2 column 16 - Warning: discarding unexpected </bogustag>
line 1 column 1 - Warning: inserting missing 'title' element

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com