📄 function.tidy-diagnose.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head> <title>Run configured diagnostics on parsed and repaired markup</title> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.tidy-construct.html">tidy::__construct</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.tidy-error-count.html">tidy_error_count</a></div> <div class="up"><a href="ref.tidy.html">Tidy Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.tidy-diagnose" class="refentry"> <div class="refnamediv"> <h1 class="refname">tidy_diagnose</h1> <p class="verinfo">(PHP 5, PECL tidy:0.5.2-1.2)</p><p class="refpurpose"><span class="refname">tidy_diagnose</span> — <span class="dc-title">Run configured diagnostics on parsed and repaired markup</span></p> </div> <div class="refsect1 unknown"> <h3 class="title">Description</h3> <p class="para">Procedural style:</p> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><b><b>tidy_diagnose</b></b></span> ( <span class="methodparam"><span class="type"><span class="type tidy">tidy</span></span> <tt class="parameter">$object</tt></span> )</div> <p class="para rdfs-comment">Object oriented style:</p> <div class="methodsynopsis dc-description"> <span class="type">bool</span> <span class="methodname"><b><b>tidy->diagnose</b></b></span> ( <span class="methodparam">void</span> )</div> <p class="para rdfs-comment"> <b>tidy_diagnose()</b> runs diagnostic tests on the given tidy <i><tt class="parameter">object</tt></i>, adding some more information about the document in the error buffer. </p> <p class="para"> Returns <b><tt>TRUE</tt></b> on success or <b><tt>FALSE</tt></b> on failure. </p> <p class="para"> <div class="example"> <p><b>Example #1 <b>tidy_diagnose()</b> example</b></p> <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB"><?php<br /><br />$html </span><span style="color: #007700">= <<< HTML<br /></span><span style="color: #0000BB"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"<br />"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><br /><br /><p>paragraph</p><br /></span><span style="color: #007700">HTML;<br /><br /></span><span style="color: #0000BB">$tidy </span><span style="color: #007700">= </span><span style="color: #0000BB">tidy_parse_string</span><span style="color: #007700">(</span><span style="color: #0000BB">$html</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-></span><span style="color: #0000BB">CleanRepair</span><span style="color: #007700">();<br /><br /></span><span style="color: #FF8000">// note the difference between the two outputs<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">tidy_get_error_buffer</span><span style="color: #007700">(</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$tidy</span><span style="color: #007700">-></span><span style="color: #0000BB">diagnose</span><span style="color: #007700">();<br />echo </span><span style="color: #0000BB">tidy_get_error_buffer</span><span style="color: #007700">(</span><span style="color: #0000BB">$tidy</span><span style="color: #007700">);<br /><br /></span><span style="color: #0000BB">?></span></span></code></div> </div> <div class="example-contents"><p>The above example will output:</p></div> <div class="example-contents"><pre><div class="cdata"><pre>line 5 column 1 - Warning: <p> isn't allowed in <head> elementsline 5 column 1 - Warning: inserting missing 'title' elementline 5 column 1 - Warning: <p> isn't allowed in <head> elementsline 5 column 1 - Warning: inserting missing 'title' elementInfo: Doctype given is "-//W3C//DTD XHTML 1.0 Strict//EN"Info: Document content looks like XHTML 1.0 Strict2 warnings, 0 errors were found!</pre></div> </pre></div> </div> </p> <p class="para"> See also <a href="function.tidy-get-error-buffer.html" class="function">tidy_get_error_buffer()</a>. </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.tidy-construct.html">tidy::__construct</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.tidy-error-count.html">tidy_error_count</a></div> <div class="up"><a href="ref.tidy.html">Tidy Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -