note 48981 deleted from ref.tidy by thiago
| From: | thiago@php.net | Date: | Fri, 06 Feb 2009 16:01:40 +0000 |
| Subject: | note 48981 deleted from ref.tidy by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-150311@lists.php.net to get a copy of this message | ||
Note Submitter:
----
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>