Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 05cd670d8a02b2b4a0ffb1756f2e8308 > files > 10989

php-manual-zh-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>Tidy Functions</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PHP 手册"
HREF="index.html"><LINK
REL="UP"
TITLE="函数参考"
HREF="funcref.html"><LINK
REL="PREVIOUS"
TITLE="tcpwrap_check"
HREF="function.tcpwrap-check.html"><LINK
REL="NEXT"
TITLE="ob_tidyhandler"
HREF="function.ob-tidyhandler.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="reference"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP 手册</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="function.tcpwrap-check.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.ob-tidyhandler.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="reference"
><A
NAME="ref.tidy"
></A
><DIV
CLASS="TITLEPAGE"
><H1
CLASS="title"
>CLXVI. Tidy Functions</H1
><DIV
CLASS="PARTINTRO"
><A
NAME="AEN233395"
></A
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="tidy.intro"
>简介</A
></H1
><P
>&#13;     Tidy is a binding for the Tidy HTML clean and repair utility which
     allows you to not only clean and otherwise manipulate HTML documents,
     but also traverse the document tree.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="tidy.requirements"
>需求</A
></H1
><P
>&#13;     To use Tidy, you will need libtidy installed, available
     on the tidy homepage <A
HREF="http://tidy.sourceforge.net/"
TARGET="_top"
>http://tidy.sourceforge.net/</A
>.
    </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="tidy.installation"
>安装</A
></H1
><P
>&#13;  Tidy is currently available for PHP 4.3.x and PHP 5 as a PECL
  extension from
  <A
HREF="http://pecl.php.net/package/tidy"
TARGET="_top"
>http://pecl.php.net/package/tidy</A
>.
 </P
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>注意: </B
>
   Tidy 1.0 is just for PHP 4.3.x, while Tidy 2.0 is just for PHP 5.
  </P
></BLOCKQUOTE
></DIV
><P
>&#13;  If <A
HREF="http://pear.php.net/"
TARGET="_top"
>PEAR</A
> is available on your *nix-like
  system you can use the pear installer to install the tidy extension, by the
  following command: <B
CLASS="command"
>pecl install tidy</B
>.
 </P
><P
>&#13;  You can always download the tar.gz package and install tidy by hand:
  <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN233413"
></A
><P
><B
>例 1. tidy install by hand in PHP 4.3.x</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><PRE
CLASS="shell"
>gunzip tidy-xxx.tgz
tar -xvf tidy-xxx.tar
cd tidy-xxx
phpize
./configure &#38;&#38; make &#38;&#38; make install</PRE
></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
 </P
><P
>&#13;  Windows users can download the extension dll from <A
HREF="http://pecl4win.php.net/ext.php/php_tidy.dll"
TARGET="_top"
>http://pecl4win.php.net/ext.php/php_tidy.dll</A
>.
 </P
><P
>&#13;  In PHP 5 you need only to compile using the <CODE
CLASS="option"
>--with-tidy</CODE
> option.
 </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="tidy.configuration"
>运行时配置</A
></H1
><P
>这些函数的行为受 <TT
CLASS="filename"
>php.ini</TT
> 的影响。</P
><P
>&#13;  <DIV
CLASS="table"
><A
NAME="AEN233425"
></A
><P
><B
>表 1. Tidy Configuration Options</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><COL><COL><COL><THEAD
><TR
><TH
>Name</TH
><TH
>Default</TH
><TH
>Changeable</TH
><TH
>Changelog</TH
></TR
></THEAD
><TBODY
><TR
><TD
>tidy.default_config</TD
><TD
>""</TD
><TD
>PHP_INI_SYSTEM</TD
><TD
>Available since PHP 5.0.0.</TD
></TR
><TR
><TD
>tidy.clean_output</TD
><TD
>"0"</TD
><TD
>PHP_INI_PERDIR</TD
><TD
>Available since PHP 5.0.0.</TD
></TR
></TBODY
></TABLE
></DIV
>
  有关 PHP_INI_* 常量进一步的细节与定义参见<A
HREF="ini.html"
>附录 H</A
>。
 </P
><P
>以下是配置选项的简要解释。</P
><P
>&#13;  <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
><A
NAME="ini.tidy.default-config"
></A
><CODE
CLASS="parameter"
>tidy.default_config</CODE
>
     <A
HREF="language.types.string.html"
><B
CLASS="type"
>string</B
></A
></DT
><DD
><P
>&#13;      Default path for tidy config file.
     </P
></DD
><DT
><A
NAME="ini.tidy.clean-output"
></A
><CODE
CLASS="parameter"
>tidy.clean_output</CODE
>
     <A
HREF="language.types.boolean.html"
><B
CLASS="type"
>boolean</B
></A
></DT
><DD
><P
>&#13;      Turns on/off the output repairing by Tidy.
     </P
><DIV
CLASS="warning"
><P
></P
><TABLE
CLASS="warning"
BORDER="1"
WIDTH="100%"
><TR
><TD
ALIGN="CENTER"
><B
>警告</B
></TD
></TR
><TR
><TD
ALIGN="LEFT"
><P
>&#13;       Do not turn on <TT
CLASS="literal"
>tidy.clean_output</TT
> if you are generating
       non-html content such as dynamic images.
      </P
></TD
></TR
></TABLE
></DIV
></DD
></DL
></DIV
>
 </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="tidy.resources"
>资源类型</A
></H1
><P
>本扩展模块未定义任何资源类型。</P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="tidy.classes"
>预定义类</A
></H1
><DIV
CLASS="section"
><H2
CLASS="section"
><A
NAME="tidy.class.tidynode"
><B
CLASS="classname"
>tidyNode</B
></A
></H2
><DIV
CLASS="section"
><H3
CLASS="section"
><A
NAME="tidy.class.tidynode.methods"
>方法</A
></H3
><P
></P
><UL
><LI
><P
><A
HREF="function.tidynode-getparent.html"
>tidyNode::getParent</A
> - Returns the parent of the current node</P
></LI
><LI
><P
><A
HREF="function.tidynode-haschildren.html"
>tidyNode-&#62;hasChildren</A
> - Returns <TT
CLASS="constant"
><B
>TRUE</B
></TT
> if the current node has children</P
></LI
><LI
><P
><A
HREF="function.tidynode-hassiblings.html"
>tidyNode-&#62;hasSiblings</A
> - Returns <TT
CLASS="constant"
><B
>TRUE</B
></TT
> if the current node has siblings</P
></LI
><LI
><P
><A
HREF="function.tidynode-isasp.html"
>tidyNode-&#62;isAsp</A
> - Returns <TT
CLASS="constant"
><B
>TRUE</B
></TT
> if the current node is ASP code</P
></LI
><LI
><P
><A
HREF="function.tidynode-iscomment.html"
>tidyNode-&#62;isComment</A
> - Returns <TT
CLASS="constant"
><B
>TRUE</B
></TT
> if the current node is a comment</P
></LI
><LI
><P
><A
HREF="function.tidynode-ishtml.html"
>tidyNode-&#62;isHtml</A
> - Returns <TT
CLASS="constant"
><B
>TRUE</B
></TT
> if the current node is HTML</P
></LI
><LI
><P
><A
HREF="function.tidynode-isjste.html"
>tidyNode-&#62;isJste</A
> - Returns <TT
CLASS="constant"
><B
>TRUE</B
></TT
> if the current node is JSTE</P
></LI
><LI
><P
><A
HREF="function.tidynode-isphp.html"
>tidyNode-&#62;isPhp</A
> - Returns <TT
CLASS="constant"
><B
>TRUE</B
></TT
> if the current node is PHP</P
></LI
><LI
><P
><A
HREF="function.tidynode-istext.html"
>tidyNode-&#62;isText</A
> - Returns <TT
CLASS="constant"
><B
>TRUE</B
></TT
> if the current node is Text (no markup)</P
></LI
></UL
></DIV
><DIV
CLASS="section"
><H3
CLASS="section"
><A
NAME="tidy.class.tidynode.properties"
>属性</A
></H3
><P
></P
><UL
><LI
><P
>value - the value of the node (e.g. the html text)</P
></LI
><LI
><P
>name - the name of the tag (e.g. html, a, etc..)</P
></LI
><LI
><P
>type - the type of the node (one of the constants above, e.g. <TT
CLASS="constant"
><B
>TIDY_NODETYPE_PHP</B
></TT
>)</P
></LI
><LI
><P
>line* - the line where the node starts</P
></LI
><LI
><P
>column* - the column where the node starts</P
></LI
><LI
><P
>proprietary* - <TT
CLASS="constant"
><B
>TRUE</B
></TT
> if the node refers to a proprietary tag</P
></LI
><LI
><P
>id - the ID of the tag (one of the constants above, e.g. <TT
CLASS="constant"
><B
>TIDY_TAG_FRAME</B
></TT
>)</P
></LI
><LI
><P
>attribute - an array with the attributes of the current node, or <TT
CLASS="constant"
><B
>NULL</B
></TT
> if there aren't any</P
></LI
><LI
><P
>child - an array with the child tidyNodes, or <TT
CLASS="constant"
><B
>NULL</B
></TT
> if there aren't any</P
></LI
></UL
><DIV
CLASS="note"
><BLOCKQUOTE
CLASS="note"
><P
><B
>注意: </B
>
        The properties marked with * are just available since PHP 5.1.0.
       </P
></BLOCKQUOTE
></DIV
></DIV
></DIV
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="tidy.constants"
>预定义常量</A
></H1
><P
>以下常量由本扩展模块定义,因此只有在本扩展模块被编译到
PHP 中,或者在运行时被动态加载后才有效。</P
><P
>&#13;  Each <TT
CLASS="literal"
>TIDY_TAG_XXX</TT
> represents a HTML tag. For example,
  <TT
CLASS="constant"
><B
>TIDY_TAG_A</B
></TT
> represents a &#60;a
  href="XX"&#62;link&#60;/a&#62; tag. Each <TT
CLASS="literal"
>TIDY_ATTR_XXX</TT
>
  represents a HTML atribute. For example <TT
CLASS="constant"
><B
>TIDY_ATTR_HREF</B
></TT
>
  would represent the href atribute in the previous example.
 </P
><P
>&#13;  The following constants are defined:
  <DIV
CLASS="table"
><A
NAME="AEN233548"
></A
><P
><B
>表 2. tidy tag constants</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><THEAD
><TR
><TH
>constant</TH
></TR
></THEAD
><TBODY
><TR
><TD
>TIDY_TAG_UNKNOWN</TD
></TR
><TR
><TD
>TIDY_TAG_A</TD
></TR
><TR
><TD
>TIDY_TAG_ABBR</TD
></TR
><TR
><TD
>TIDY_TAG_ACRONYM</TD
></TR
><TR
><TD
>TIDY_TAG_ALIGN</TD
></TR
><TR
><TD
>TIDY_TAG_APPLET</TD
></TR
><TR
><TD
>TIDY_TAG_AREA</TD
></TR
><TR
><TD
>TIDY_TAG_B</TD
></TR
><TR
><TD
>TIDY_TAG_BASE</TD
></TR
><TR
><TD
>TIDY_TAG_BASEFONT</TD
></TR
><TR
><TD
>TIDY_TAG_BDO</TD
></TR
><TR
><TD
>TIDY_TAG_BGSOUND</TD
></TR
><TR
><TD
>TIDY_TAG_BIG</TD
></TR
><TR
><TD
>TIDY_TAG_BLINK</TD
></TR
><TR
><TD
>TIDY_TAG_BLOCKQUOTE</TD
></TR
><TR
><TD
>TIDY_TAG_BODY</TD
></TR
><TR
><TD
>TIDY_TAG_BR</TD
></TR
><TR
><TD
>TIDY_TAG_BUTTON</TD
></TR
><TR
><TD
>TIDY_TAG_CAPTION</TD
></TR
><TR
><TD
>TIDY_TAG_CENTER</TD
></TR
><TR
><TD
>TIDY_TAG_CITE</TD
></TR
><TR
><TD
>TIDY_TAG_CODE</TD
></TR
><TR
><TD
>TIDY_TAG_COL</TD
></TR
><TR
><TD
>TIDY_TAG_COLGROUP</TD
></TR
><TR
><TD
>TIDY_TAG_COMMENT</TD
></TR
><TR
><TD
>TIDY_TAG_DD</TD
></TR
><TR
><TD
>TIDY_TAG_DEL</TD
></TR
><TR
><TD
>TIDY_TAG_DFN</TD
></TR
><TR
><TD
>TIDY_TAG_DIR</TD
></TR
><TR
><TD
>TIDY_TAG_DIV</TD
></TR
><TR
><TD
>TIDY_TAG_DL</TD
></TR
><TR
><TD
>TIDY_TAG_DT</TD
></TR
><TR
><TD
>TIDY_TAG_EM</TD
></TR
><TR
><TD
>TIDY_TAG_EMBED</TD
></TR
><TR
><TD
>TIDY_TAG_FIELDSET</TD
></TR
><TR
><TD
>TIDY_TAG_FONT</TD
></TR
><TR
><TD
>TIDY_TAG_FORM</TD
></TR
><TR
><TD
>TIDY_TAG_FRAME</TD
></TR
><TR
><TD
>TIDY_TAG_FRAMESET</TD
></TR
><TR
><TD
>TIDY_TAG_H1</TD
></TR
><TR
><TD
>TIDY_TAG_H2</TD
></TR
><TR
><TD
>TIDY_TAG_H3</TD
></TR
><TR
><TD
>TIDY_TAG_H4</TD
></TR
><TR
><TD
>TIDY_TAG_H5</TD
></TR
><TR
><TD
>TIDY_TAG_H6</TD
></TR
><TR
><TD
>TIDY_TAG_HEAD</TD
></TR
><TR
><TD
>TIDY_TAG_HR</TD
></TR
><TR
><TD
>TIDY_TAG_HTML</TD
></TR
><TR
><TD
>TIDY_TAG_I</TD
></TR
><TR
><TD
>TIDY_TAG_IFRAME</TD
></TR
><TR
><TD
>TIDY_TAG_ILAYER</TD
></TR
><TR
><TD
>TIDY_TAG_IMG</TD
></TR
><TR
><TD
>TIDY_TAG_INPUT</TD
></TR
><TR
><TD
>TIDY_TAG_INS</TD
></TR
><TR
><TD
>TIDY_TAG_ISINDEX</TD
></TR
><TR
><TD
>TIDY_TAG_KBD</TD
></TR
><TR
><TD
>TIDY_TAG_KEYGEN</TD
></TR
><TR
><TD
>TIDY_TAG_LABEL</TD
></TR
><TR
><TD
>TIDY_TAG_LAYER</TD
></TR
><TR
><TD
>TIDY_TAG_LEGEND</TD
></TR
><TR
><TD
>TIDY_TAG_LI</TD
></TR
><TR
><TD
>TIDY_TAG_LINK</TD
></TR
><TR
><TD
>TIDY_TAG_LISTING</TD
></TR
><TR
><TD
>TIDY_TAG_MAP</TD
></TR
><TR
><TD
>TIDY_TAG_MARQUEE</TD
></TR
><TR
><TD
>TIDY_TAG_MENU</TD
></TR
><TR
><TD
>TIDY_TAG_META</TD
></TR
><TR
><TD
>TIDY_TAG_MULTICOL</TD
></TR
><TR
><TD
>TIDY_TAG_NOBR</TD
></TR
><TR
><TD
>TIDY_TAG_NOEMBED</TD
></TR
><TR
><TD
>TIDY_TAG_NOFRAMES</TD
></TR
><TR
><TD
>TIDY_TAG_NOLAYER</TD
></TR
><TR
><TD
>TIDY_TAG_NOSAVE</TD
></TR
><TR
><TD
>TIDY_TAG_NOSCRIPT</TD
></TR
><TR
><TD
>TIDY_TAG_OBJECT</TD
></TR
><TR
><TD
>TIDY_TAG_OL</TD
></TR
><TR
><TD
>TIDY_TAG_OPTGROUP</TD
></TR
><TR
><TD
>TIDY_TAG_OPTION</TD
></TR
><TR
><TD
>TIDY_TAG_P</TD
></TR
><TR
><TD
>TIDY_TAG_PARAM</TD
></TR
><TR
><TD
>TIDY_TAG_PLAINTEXT</TD
></TR
><TR
><TD
>TIDY_TAG_PRE</TD
></TR
><TR
><TD
>TIDY_TAG_Q</TD
></TR
><TR
><TD
>TIDY_TAG_RP</TD
></TR
><TR
><TD
>TIDY_TAG_RT</TD
></TR
><TR
><TD
>TIDY_TAG_RTC</TD
></TR
><TR
><TD
>TIDY_TAG_RUBY</TD
></TR
><TR
><TD
>TIDY_TAG_S</TD
></TR
><TR
><TD
>TIDY_TAG_SAMP</TD
></TR
><TR
><TD
>TIDY_TAG_SCRIPT</TD
></TR
><TR
><TD
>TIDY_TAG_SELECT</TD
></TR
><TR
><TD
>TIDY_TAG_SERVER</TD
></TR
><TR
><TD
>TIDY_TAG_SERVLET</TD
></TR
><TR
><TD
>TIDY_TAG_SMALL</TD
></TR
><TR
><TD
>TIDY_TAG_SPACER</TD
></TR
><TR
><TD
>TIDY_TAG_SPAN</TD
></TR
><TR
><TD
>TIDY_TAG_STRIKE</TD
></TR
><TR
><TD
>TIDY_TAG_STRONG</TD
></TR
><TR
><TD
>TIDY_TAG_STYLE</TD
></TR
><TR
><TD
>TIDY_TAG_SUB</TD
></TR
><TR
><TD
>TIDY_TAG_TABLE</TD
></TR
><TR
><TD
>TIDY_TAG_TBODY</TD
></TR
><TR
><TD
>TIDY_TAG_TD</TD
></TR
><TR
><TD
>TIDY_TAG_TEXTAREA</TD
></TR
><TR
><TD
>TIDY_TAG_TFOOT</TD
></TR
><TR
><TD
>TIDY_TAG_TH</TD
></TR
><TR
><TD
>TIDY_TAG_THEAD</TD
></TR
><TR
><TD
>TIDY_TAG_TITLE</TD
></TR
><TR
><TD
>TIDY_TAG_TR</TD
></TR
><TR
><TD
>TIDY_TAG_TR</TD
></TR
><TR
><TD
>TIDY_TAG_TT</TD
></TR
><TR
><TD
>TIDY_TAG_U</TD
></TR
><TR
><TD
>TIDY_TAG_UL</TD
></TR
><TR
><TD
>TIDY_TAG_VAR</TD
></TR
><TR
><TD
>TIDY_TAG_WBR</TD
></TR
><TR
><TD
>TIDY_TAG_XMP</TD
></TR
></TBODY
></TABLE
></DIV
>
 </P
><P
>&#13;  <DIV
CLASS="table"
><A
NAME="AEN233788"
></A
><P
><B
>表 3. tidy attribute constants</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><THEAD
><TR
><TH
>constant</TH
></TR
></THEAD
><TBODY
><TR
><TD
>TIDY_ATTR_UNKNOWN</TD
></TR
><TR
><TD
>TIDY_ATTR_ABBR</TD
></TR
><TR
><TD
>TIDY_ATTR_ACCEPT</TD
></TR
><TR
><TD
>TIDY_ATTR_ACCEPT_CHARSET</TD
></TR
><TR
><TD
>TIDY_ATTR_ACCESSKEY</TD
></TR
><TR
><TD
>TIDY_ATTR_ACTION</TD
></TR
><TR
><TD
>TIDY_ATTR_ADD_DATE</TD
></TR
><TR
><TD
>TIDY_ATTR_ALIGN</TD
></TR
><TR
><TD
>TIDY_ATTR_ALINK</TD
></TR
><TR
><TD
>TIDY_ATTR_ALT</TD
></TR
><TR
><TD
>TIDY_ATTR_ARCHIVE</TD
></TR
><TR
><TD
>TIDY_ATTR_AXIS</TD
></TR
><TR
><TD
>TIDY_ATTR_BACKGROUND</TD
></TR
><TR
><TD
>TIDY_ATTR_BGCOLOR</TD
></TR
><TR
><TD
>TIDY_ATTR_BGPROPERTIES</TD
></TR
><TR
><TD
>TIDY_ATTR_BORDER</TD
></TR
><TR
><TD
>TIDY_ATTR_BORDERCOLOR</TD
></TR
><TR
><TD
>TIDY_ATTR_BOTTOMMARGIN</TD
></TR
><TR
><TD
>TIDY_ATTR_CELLPADDING</TD
></TR
><TR
><TD
>TIDY_ATTR_CELLSPACING</TD
></TR
><TR
><TD
>TIDY_ATTR_CHAR</TD
></TR
><TR
><TD
>TIDY_ATTR_CHAROFF</TD
></TR
><TR
><TD
>TIDY_ATTR_CHARSET</TD
></TR
><TR
><TD
>TIDY_ATTR_CHECKED</TD
></TR
><TR
><TD
>TIDY_ATTR_CITE</TD
></TR
><TR
><TD
>TIDY_ATTR_CLASS</TD
></TR
><TR
><TD
>TIDY_ATTR_CLASSID</TD
></TR
><TR
><TD
>TIDY_ATTR_CLEAR</TD
></TR
><TR
><TD
>TIDY_ATTR_CODE</TD
></TR
><TR
><TD
>TIDY_ATTR_CODEBASE</TD
></TR
><TR
><TD
>TIDY_ATTR_CODETYPE</TD
></TR
><TR
><TD
>TIDY_ATTR_COLOR</TD
></TR
><TR
><TD
>TIDY_ATTR_COLS</TD
></TR
><TR
><TD
>TIDY_ATTR_COLSPAN</TD
></TR
><TR
><TD
>TIDY_ATTR_COMPACT</TD
></TR
><TR
><TD
>TIDY_ATTR_CONTENT</TD
></TR
><TR
><TD
>TIDY_ATTR_COORDS</TD
></TR
><TR
><TD
>TIDY_ATTR_DATA</TD
></TR
><TR
><TD
>TIDY_ATTR_DATAFLD</TD
></TR
><TR
><TD
>TIDY_ATTR_DATAPAGESIZE</TD
></TR
><TR
><TD
>TIDY_ATTR_DATASRC</TD
></TR
><TR
><TD
>TIDY_ATTR_DATETIME</TD
></TR
><TR
><TD
>TIDY_ATTR_DECLARE</TD
></TR
><TR
><TD
>TIDY_ATTR_DEFER</TD
></TR
><TR
><TD
>TIDY_ATTR_DIR</TD
></TR
><TR
><TD
>TIDY_ATTR_DISABLED</TD
></TR
><TR
><TD
>TIDY_ATTR_ENCODING</TD
></TR
><TR
><TD
>TIDY_ATTR_ENCTYPE</TD
></TR
><TR
><TD
>TIDY_ATTR_FACE</TD
></TR
><TR
><TD
>TIDY_ATTR_FOR</TD
></TR
><TR
><TD
>TIDY_ATTR_FRAME</TD
></TR
><TR
><TD
>TIDY_ATTR_FRAMEBORDER</TD
></TR
><TR
><TD
>TIDY_ATTR_FRAMESPACING</TD
></TR
><TR
><TD
>TIDY_ATTR_GRIDX</TD
></TR
><TR
><TD
>TIDY_ATTR_GRIDY</TD
></TR
><TR
><TD
>TIDY_ATTR_HEADERS</TD
></TR
><TR
><TD
>TIDY_ATTR_HEIGHT</TD
></TR
><TR
><TD
>TIDY_ATTR_HREF</TD
></TR
><TR
><TD
>TIDY_ATTR_HREFLANG</TD
></TR
><TR
><TD
>TIDY_ATTR_HSPACE</TD
></TR
><TR
><TD
>TIDY_ATTR_HTTP_EQUIV</TD
></TR
><TR
><TD
>TIDY_ATTR_ID</TD
></TR
><TR
><TD
>TIDY_ATTR_ISMAP</TD
></TR
><TR
><TD
>TIDY_ATTR_LABEL</TD
></TR
><TR
><TD
>TIDY_ATTR_LANG</TD
></TR
><TR
><TD
>TIDY_ATTR_LANGUAGE</TD
></TR
><TR
><TD
>TIDY_ATTR_LAST_MODIFIED</TD
></TR
><TR
><TD
>TIDY_ATTR_LAST_VISIT</TD
></TR
><TR
><TD
>TIDY_ATTR_LEFTMARGIN</TD
></TR
><TR
><TD
>TIDY_ATTR_LINK</TD
></TR
><TR
><TD
>TIDY_ATTR_LONGDESC</TD
></TR
><TR
><TD
>TIDY_ATTR_LOWSRC</TD
></TR
><TR
><TD
>TIDY_ATTR_MARGINHEIGHT</TD
></TR
><TR
><TD
>TIDY_ATTR_MARGINWIDTH</TD
></TR
><TR
><TD
>TIDY_ATTR_MAXLENGTH</TD
></TR
><TR
><TD
>TIDY_ATTR_MEDIA</TD
></TR
><TR
><TD
>TIDY_ATTR_METHOD</TD
></TR
><TR
><TD
>TIDY_ATTR_MULTIPLE</TD
></TR
><TR
><TD
>TIDY_ATTR_NAME</TD
></TR
><TR
><TD
>TIDY_ATTR_NOHREF</TD
></TR
><TR
><TD
>TIDY_ATTR_NORESIZE</TD
></TR
><TR
><TD
>TIDY_ATTR_NOSHADE</TD
></TR
><TR
><TD
>TIDY_ATTR_NOWRAP</TD
></TR
><TR
><TD
>TIDY_ATTR_OBJECT</TD
></TR
><TR
><TD
>TIDY_ATTR_OnAFTERUPDATE</TD
></TR
><TR
><TD
>TIDY_ATTR_OnBEFOREUNLOAD</TD
></TR
><TR
><TD
>TIDY_ATTR_OnBEFOREUPDATE</TD
></TR
><TR
><TD
>TIDY_ATTR_OnBLUR</TD
></TR
><TR
><TD
>TIDY_ATTR_OnCHANGE</TD
></TR
><TR
><TD
>TIDY_ATTR_OnCLICK</TD
></TR
><TR
><TD
>TIDY_ATTR_OnDATAAVAILABLE</TD
></TR
><TR
><TD
>TIDY_ATTR_OnDATASETCHANGED</TD
></TR
><TR
><TD
>TIDY_ATTR_OnDATASETCOMPLETE</TD
></TR
><TR
><TD
>TIDY_ATTR_OnDBLCLICK</TD
></TR
><TR
><TD
>TIDY_ATTR_OnERRORUPDATE</TD
></TR
><TR
><TD
>TIDY_ATTR_OnFOCUS</TD
></TR
><TR
><TD
>TIDY_ATTR_OnKEYDOWN</TD
></TR
><TR
><TD
>TIDY_ATTR_OnKEYPRESS</TD
></TR
><TR
><TD
>TIDY_ATTR_OnKEYUP</TD
></TR
><TR
><TD
>TIDY_ATTR_OnLOAD</TD
></TR
><TR
><TD
>TIDY_ATTR_OnMOUSEDOWN</TD
></TR
><TR
><TD
>TIDY_ATTR_OnMOUSEMOVE</TD
></TR
><TR
><TD
>TIDY_ATTR_OnMOUSEOUT</TD
></TR
><TR
><TD
>TIDY_ATTR_OnMOUSEOVER</TD
></TR
><TR
><TD
>TIDY_ATTR_OnMOUSEUP</TD
></TR
><TR
><TD
>TIDY_ATTR_OnRESET</TD
></TR
><TR
><TD
>TIDY_ATTR_OnROWENTER</TD
></TR
><TR
><TD
>TIDY_ATTR_OnROWEXIT</TD
></TR
><TR
><TD
>TIDY_ATTR_OnSELECT</TD
></TR
><TR
><TD
>TIDY_ATTR_OnSUBMIT</TD
></TR
><TR
><TD
>TIDY_ATTR_OnUNLOAD</TD
></TR
><TR
><TD
>TIDY_ATTR_PROFILE</TD
></TR
><TR
><TD
>TIDY_ATTR_PROMPT</TD
></TR
><TR
><TD
>TIDY_ATTR_RBSPAN</TD
></TR
><TR
><TD
>TIDY_ATTR_READONLY</TD
></TR
><TR
><TD
>TIDY_ATTR_REL</TD
></TR
><TR
><TD
>TIDY_ATTR_REV</TD
></TR
><TR
><TD
>TIDY_ATTR_RIGHTMARGIN</TD
></TR
><TR
><TD
>TIDY_ATTR_ROWS</TD
></TR
><TR
><TD
>TIDY_ATTR_ROWSPAN</TD
></TR
><TR
><TD
>TIDY_ATTR_RULES</TD
></TR
><TR
><TD
>TIDY_ATTR_SCHEME</TD
></TR
><TR
><TD
>TIDY_ATTR_SCOPE</TD
></TR
><TR
><TD
>TIDY_ATTR_SCROLLING</TD
></TR
><TR
><TD
>TIDY_ATTR_SELECTED</TD
></TR
><TR
><TD
>TIDY_ATTR_SHAPE</TD
></TR
><TR
><TD
>TIDY_ATTR_SHOWGRID</TD
></TR
><TR
><TD
>TIDY_ATTR_SHOWGRIDX</TD
></TR
><TR
><TD
>TIDY_ATTR_SHOWGRIDY</TD
></TR
><TR
><TD
>TIDY_ATTR_SIZE</TD
></TR
><TR
><TD
>TIDY_ATTR_SPAN</TD
></TR
><TR
><TD
>TIDY_ATTR_SRC</TD
></TR
><TR
><TD
>TIDY_ATTR_STANDBY</TD
></TR
><TR
><TD
>TIDY_ATTR_START</TD
></TR
><TR
><TD
>TIDY_ATTR_STYLE</TD
></TR
><TR
><TD
>TIDY_ATTR_SUMMARY</TD
></TR
><TR
><TD
>TIDY_ATTR_TABINDEX</TD
></TR
><TR
><TD
>TIDY_ATTR_TARGET</TD
></TR
><TR
><TD
>TIDY_ATTR_TEXT</TD
></TR
><TR
><TD
>TIDY_ATTR_TITLE</TD
></TR
><TR
><TD
>TIDY_ATTR_TOPMARGIN</TD
></TR
><TR
><TD
>TIDY_ATTR_TYPE</TD
></TR
><TR
><TD
>TIDY_ATTR_USEMAP</TD
></TR
><TR
><TD
>TIDY_ATTR_VALIGN</TD
></TR
><TR
><TD
>TIDY_ATTR_VALUE</TD
></TR
><TR
><TD
>TIDY_ATTR_VALUETYPE</TD
></TR
><TR
><TD
>TIDY_ATTR_VERSION</TD
></TR
><TR
><TD
>TIDY_ATTR_VLINK</TD
></TR
><TR
><TD
>TIDY_ATTR_VSPACE</TD
></TR
><TR
><TD
>TIDY_ATTR_WIDTH</TD
></TR
><TR
><TD
>TIDY_ATTR_WRAP</TD
></TR
><TR
><TD
>TIDY_ATTR_XML_LANG</TD
></TR
><TR
><TD
>TIDY_ATTR_XML_SPACE</TD
></TR
><TR
><TD
>TIDY_ATTR_XMLNS</TD
></TR
></TBODY
></TABLE
></DIV
>
 </P
><P
>&#13;  <DIV
CLASS="table"
><A
NAME="AEN234104"
></A
><P
><B
>表 4. tidy nodetype constants</B
></P
><TABLE
BORDER="1"
CLASS="CALSTABLE"
><COL><COL><THEAD
><TR
><TH
>constant</TH
><TH
>description</TH
></TR
></THEAD
><TBODY
><TR
><TD
>TIDY_NODETYPE_ROOT</TD
><TD
>root node</TD
></TR
><TR
><TD
>TIDY_NODETYPE_DOCTYPE</TD
><TD
>doctype</TD
></TR
><TR
><TD
>TIDY_NODETYPE_COMMENT</TD
><TD
>HTML comment</TD
></TR
><TR
><TD
>TIDY_NODETYPE_PROCINS</TD
><TD
>Processing Instruction</TD
></TR
><TR
><TD
>TIDY_NODETYPE_TEXT</TD
><TD
>Text</TD
></TR
><TR
><TD
>TIDY_NODETYPE_START</TD
><TD
>start tag</TD
></TR
><TR
><TD
>TIDY_NODETYPE_END</TD
><TD
>end tag</TD
></TR
><TR
><TD
>TIDY_NODETYPE_STARTEND</TD
><TD
>empty tag</TD
></TR
><TR
><TD
>TIDY_NODETYPE_CDATA</TD
><TD
>CDATA</TD
></TR
><TR
><TD
>TIDY_NODETYPE_SECTION</TD
><TD
>XML section</TD
></TR
><TR
><TD
>TIDY_NODETYPE_ASP</TD
><TD
>ASP code</TD
></TR
><TR
><TD
>TIDY_NODETYPE_JSTE</TD
><TD
>JSTE code</TD
></TR
><TR
><TD
>TIDY_NODETYPE_PHP</TD
><TD
>PHP code</TD
></TR
><TR
><TD
>TIDY_NODETYPE_XMLDECL</TD
><TD
>XML declaration</TD
></TR
></TBODY
></TABLE
></DIV
>
 </P
></DIV
><DIV
CLASS="section"
><H1
CLASS="section"
><A
NAME="tidy.examples"
>范例</A
></H1
><P
>&#13;     This simple example shows basic Tidy usage.
     <TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
CLASS="EXAMPLE"
><TR
><TD
><DIV
CLASS="example"
><A
NAME="AEN234157"
></A
><P
><B
>例 2. Basic Tidy usage</B
></P
><TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
<font color="#0000BB">&lt;?php<br />ob_start</font><font color="#007700">();<br /></font><font color="#0000BB">?&gt;<br /></font>&lt;html&gt;a html document&lt;/html&gt;<br /><font color="#0000BB">&lt;?php<br />$html </font><font color="#007700">= </font><font color="#0000BB">ob_get_clean</font><font color="#007700">();<br /><br /></font><font color="#FF8000">// Specify configuration<br /></font><font color="#0000BB">$config </font><font color="#007700">= array(<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'indent'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; </font><font color="#0000BB">true</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'output-xhtml'&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; </font><font color="#0000BB">true</font><font color="#007700">,<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#DD0000">'wrap'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font><font color="#007700">=&gt; </font><font color="#0000BB">200</font><font color="#007700">);<br /><br /></font><font color="#FF8000">// Tidy<br /></font><font color="#0000BB">$tidy </font><font color="#007700">= new </font><font color="#0000BB">tidy</font><font color="#007700">;<br /></font><font color="#0000BB">$tidy</font><font color="#007700">-&gt;</font><font color="#0000BB">parseString</font><font color="#007700">(</font><font color="#0000BB">$html</font><font color="#007700">, </font><font color="#0000BB">$config</font><font color="#007700">, </font><font color="#DD0000">'utf8'</font><font color="#007700">);<br /></font><font color="#0000BB">$tidy</font><font color="#007700">-&gt;</font><font color="#0000BB">cleanRepair</font><font color="#007700">();<br /><br /></font><font color="#FF8000">// Output<br /></font><font color="#007700">echo </font><font color="#0000BB">$tidy</font><font color="#007700">;<br /></font><font color="#0000BB">?&gt;</font>
</font>
</code></TD
></TR
></TABLE
></DIV
></TD
></TR
></TABLE
>
    </P
></DIV
></DIV
><DIV
CLASS="TOC"
><DL
><DT
><B
>目录</B
></DT
><DT
><A
HREF="function.ob-tidyhandler.html"
>ob_tidyhandler</A
>&nbsp;--&nbsp;
     ob_start callback function to repair the buffer
    </DT
><DT
><A
HREF="function.tidy-access-count.html"
>tidy_access_count</A
>&nbsp;--&nbsp;
     Returns the Number of Tidy accessibility warnings encountered for specified document
    </DT
><DT
><A
HREF="function.tidy-clean-repair.html"
>tidy_clean_repair</A
>&nbsp;--&nbsp;
     Execute configured cleanup and repair operations on parsed markup
    </DT
><DT
><A
HREF="function.tidy-config-count.html"
>tidy_config_count</A
>&nbsp;--&nbsp;
     Returns the Number of Tidy configuration errors encountered for specified document
    </DT
><DT
><A
HREF="function.tidy-construct.html"
>tidy::__construct</A
>&nbsp;--&nbsp;
     Constructs a new tidy object
    </DT
><DT
><A
HREF="function.tidy-diagnose.html"
>tidy_diagnose</A
>&nbsp;--&nbsp;
     Run configured diagnostics on parsed and repaired markup
    </DT
><DT
><A
HREF="function.tidy-error-count.html"
>tidy_error_count</A
>&nbsp;--&nbsp;
     Returns the Number of Tidy errors encountered for specified document
    </DT
><DT
><A
HREF="function.tidy-get-body.html"
>tidy_get_body</A
>&nbsp;--&nbsp;
     Returns a tidyNode Object starting from the &#60;body&#62; tag of the tidy parse tree
    </DT
><DT
><A
HREF="function.tidy-get-config.html"
>tidy_get_config</A
>&nbsp;--&nbsp;
     Get current Tidy configuration
    </DT
><DT
><A
HREF="function.tidy-get-error-buffer.html"
>tidy_get_error_buffer</A
>&nbsp;--&nbsp;
     Return warnings and errors which occurred parsing the specified document
    </DT
><DT
><A
HREF="function.tidy-get-head.html"
>tidy_get_head</A
>&nbsp;--&nbsp;
     Returns a tidyNode Object starting from the &#60;head&#62; tag of the tidy parse tree
    </DT
><DT
><A
HREF="function.tidy-get-html-ver.html"
>tidy_get_html_ver</A
>&nbsp;--&nbsp;
     Get the Detected HTML version for the specified document
    </DT
><DT
><A
HREF="function.tidy-get-html.html"
>tidy_get_html</A
>&nbsp;--&nbsp;
     Returns a tidyNode Object starting from the &#60;html&#62; tag of the tidy parse tree
    </DT
><DT
><A
HREF="function.tidy-get-opt-doc.html"
>tidy_get_opt_doc</A
>&nbsp;--&nbsp;
   Returns the documentation for the given option name
  </DT
><DT
><A
HREF="function.tidy-get-output.html"
>tidy_get_output</A
>&nbsp;--&nbsp;
     Return a string representing the parsed tidy markup
    </DT
><DT
><A
HREF="function.tidy-get-release.html"
>tidy_get_release</A
>&nbsp;--&nbsp;
     Get release date (version) for Tidy library
    </DT
><DT
><A
HREF="function.tidy-get-root.html"
>tidy_get_root</A
>&nbsp;--&nbsp;
     Returns a tidyNode object representing the root of the tidy parse tree
    </DT
><DT
><A
HREF="function.tidy-get-status.html"
>tidy_get_status</A
>&nbsp;--&nbsp;
     Get status of specified document
    </DT
><DT
><A
HREF="function.tidy-getopt.html"
>tidy_getopt</A
>&nbsp;--&nbsp;
     Returns the value of the specified configuration option for the tidy document
    </DT
><DT
><A
HREF="function.tidy-is-xhtml.html"
>tidy_is_xhtml</A
>&nbsp;--&nbsp;
     Indicates if the document is a XHTML document
    </DT
><DT
><A
HREF="function.tidy-is-xml.html"
>tidy_is_xml</A
>&nbsp;--&nbsp;
     Indicates if the document is a generic (non HTML/XHTML) XML document
    </DT
><DT
><A
HREF="function.tidy-load-config.html"
>tidy_load_config</A
>&nbsp;--&nbsp;
     Load an ASCII Tidy configuration file with the specified encoding
    </DT
><DT
><A
HREF="function.tidy-node-get-attr.html"
>tidy_node-&#62;get_attr</A
>&nbsp;--&nbsp;
     Return the attribute with the provided attribute id
    </DT
><DT
><A
HREF="function.tidy-node-get-nodes.html"
>tidy_node-&#62;get_nodes</A
>&nbsp;--&nbsp;
     Return an array of nodes under this node with the specified id
    </DT
><DT
><A
HREF="function.tidy-node-next.html"
>tidy_node-&#62;next</A
>&nbsp;--&nbsp;
     Returns the next sibling to this node
    </DT
><DT
><A
HREF="function.tidy-node-prev.html"
>tidy_node-&#62;prev</A
>&nbsp;--&nbsp;
     Returns the previous sibling to this node
    </DT
><DT
><A
HREF="function.tidy-parse-file.html"
>tidy_parse_file</A
>&nbsp;--&nbsp;
     Parse markup in file or URI
    </DT
><DT
><A
HREF="function.tidy-parse-string.html"
>tidy_parse_string</A
>&nbsp;--&nbsp;
     Parse a document stored in a string
    </DT
><DT
><A
HREF="function.tidy-repair-file.html"
>tidy_repair_file</A
>&nbsp;--&nbsp;
     Repair a file and return it as a string
    </DT
><DT
><A
HREF="function.tidy-repair-string.html"
>tidy_repair_string</A
>&nbsp;--&nbsp;
     Repair a string using an optionally provided configuration file
    </DT
><DT
><A
HREF="function.tidy-reset-config.html"
>tidy_reset_config</A
>&nbsp;--&nbsp;
     Restore Tidy configuration to default values
    </DT
><DT
><A
HREF="function.tidy-save-config.html"
>tidy_save_config</A
>&nbsp;--&nbsp;
     Save current settings to named file
    </DT
><DT
><A
HREF="function.tidy-set-encoding.html"
>tidy_set_encoding</A
>&nbsp;--&nbsp;
     Set the input/output character encoding for parsing markup
    </DT
><DT
><A
HREF="function.tidy-setopt.html"
>tidy_setopt</A
>&nbsp;--&nbsp;
     Updates the configuration settings for the specified tidy document
    </DT
><DT
><A
HREF="function.tidy-warning-count.html"
>tidy_warning_count</A
>&nbsp;--&nbsp;
     Returns the Number of Tidy warnings encountered for specified document
    </DT
><DT
><A
HREF="function.tidynode-haschildren.html"
>tidyNode-&#62;hasChildren</A
>&nbsp;--&nbsp;
   Returns true if this node has children
  </DT
><DT
><A
HREF="function.tidynode-hassiblings.html"
>tidyNode-&#62;hasSiblings</A
>&nbsp;--&nbsp;
   Returns true if this node has siblings
  </DT
><DT
><A
HREF="function.tidynode-isasp.html"
>tidyNode-&#62;isAsp</A
>&nbsp;--&nbsp;
     Returns true if this node is ASP
    </DT
><DT
><A
HREF="function.tidynode-iscomment.html"
>tidyNode-&#62;isComment</A
>&nbsp;--&nbsp;
   Returns true if this node represents a comment
  </DT
><DT
><A
HREF="function.tidynode-ishtml.html"
>tidyNode-&#62;isHtml</A
>&nbsp;--&nbsp;
   Returns true if this node is part of a HTML document
  </DT
><DT
><A
HREF="function.tidynode-isjste.html"
>tidyNode-&#62;isJste</A
>&nbsp;--&nbsp;
   Returns true if this node is JSTE
  </DT
><DT
><A
HREF="function.tidynode-isphp.html"
>tidyNode-&#62;isPhp</A
>&nbsp;--&nbsp;
     Returns true if this node is PHP
    </DT
><DT
><A
HREF="function.tidynode-istext.html"
>tidyNode-&#62;isText</A
>&nbsp;--&nbsp;
   Returns true if this node represents text (no markup)
  </DT
><DT
><A
HREF="function.tidynode-getparent.html"
>tidyNode::getParent</A
>&nbsp;--&nbsp;returns the parent node of the current node</DT
></DL
></DIV
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="function.tcpwrap-check.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>起始页</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.ob-tidyhandler.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>tcpwrap_check</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="funcref.html"
ACCESSKEY="U"
>上一级</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>ob_tidyhandler</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>