note 48981 added to ref.tidy
| From: | php-general at lists dot php dot net | Date: | Thu, 13 Jan 2005 19:20:46 +0000 |
| Subject: | note 48981 added to ref.tidy | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-83212@lists.php.net to get a copy of this message | ||
Just in case anyone else has been having problems using the tidy extension in *PHP4 v4.3.10. Here is
a working example:
$html = '<HTML><HEAD></HEAD><BODY>Hello
World</BODY></HTML>';
$config = array('indent'=> TRUE,
'output-xhtml' => TRUE,
'wrap' => 80);
tidy_set_encoding('UTF8');
foreach ($config as $key => $value) {
tidy_setopt($key,$value);
}
tidy_parse_string($html);
tidy_clean_repair();
echo tidy_get_output();
Resultant HTML should be similar to:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
</head>
<body>
Hello World
</body>
</html>
----
Manual Page -- http://www.php.net/manual/en/ref.tidy.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+48981
Delete -- http://master.php.net/manage/user-notes.php?action=delete+48981&report=yes
Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48981&report=yes&reason=bad+code
Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48981&report=yes&reason=spam
Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48981&report=yes&reason=useless+example
Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48981&report=yes&reason=contains+commercial+links
Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48981&report=yes&reason=useless+note
Reject -- http://master.php.net/manage/user-notes.php?action=reject+48981&report=yes
Search -- http://master.php.net/manage/user-notes.php