|
PHP5中文手册
Tidy Functions简介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. 需求To use Tidy, you will need libtidy installed, available on the tidy homepage » http://tidy.sourceforge.net/. 安装Tidy is currently available for PHP 4.3.x and PHP 5 as a PECL extension from » http://pecl.php.net/package/tidy.
If » PEAR is available on your *nix-like system you can use the pear installer to install the tidy extension, by the following command: pecl install tidy. You can always download the tar.gz package and install tidy by hand: Example#1 tidy install by hand in PHP 4.3.x gunzip tidy-xxx.tgz tar -xvf tidy-xxx.tar cd tidy-xxx phpize ./configure && make && make install Windows users can download the extension dll from » http://pecl4win.php.net/ext.php/php_tidy.dll. In PHP 5 you need only to compile using the --with-tidy option. 运行时配置这些函数的行为受 php.ini 的影响。
以下是配置选项的简要解释。
资源类型本扩展模块未定义任何资源类型。 预定义类tidyNode方法
属性
预定义常量以下常量由本扩展模块定义,因此只有在本扩展模块被编译到 PHP 中,或者在运行时被动态加载后才有效。 Each TIDY_TAG_XXX represents a HTML tag. For example, TIDY_TAG_A represents a <a href="XX">link</a> tag. Each TIDY_ATTR_XXX represents a HTML atribute. For example TIDY_ATTR_HREF would represent the href atribute in the previous example. The following constants are defined:
范例This simple example shows basic Tidy usage. Example#2 Basic Tidy usage
<?php Table of Contents
|