downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Exemples> <Constantes pré-définies
Last updated: Fri, 14 Aug 2009

view this page in

Exemples

Sommaire



add a note add a note User Contributed Notes
Exemples
nicolas [at] adaka [dot] fr
25-Nov-2008 09:33
That seems to be the correct config to symply tidy an HTML fragment (in a valid XHTML syntax) :

<?php
    $tidy_config   
=    array(
       
'clean'                            =>    true,
       
'drop-proprietary-attributes'    =>    true,
       
'output-xhtml'                    =>    true,
       
'show-body-only'                =>    true,
       
'word-2000'                        =>    true,
       
'wrap'                            =>    '0'
   
);
?>
dan [@t] authenticdesign [d_o_t] net
22-Aug-2008 05:44
If you're just looking for a quick and dirty way to output HTML code you created in a formatted way use this technique...

<?php
$html
= 'a chunk of html you created';
$config = array(
           
'indent'         => true,
           
'output-xml'     => true,
           
'input-xml'     => true,
           
'wrap'         => '1000');

// Tidy
$tidy = new tidy();
$tidy->parseString($html, $config, 'utf8');
$tidy->cleanRepair();
echo
tidy_get_output($tidy);
?>

... This seemed to get the result I wanted every time.

Exemples> <Constantes pré-définies
Last updated: Fri, 14 Aug 2009
 
 
show source | credits | sitemap | contact | advertising | mirror sites