Re: Generate XHTML (HTML compatible) Code using DOMDocument

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Michael Shadle wrote:
On Sun, Apr 12, 2009 at 8:07 AM, Raymond Irving <xwisdom@xxxxxxxxx> wrote:

   $html = preg_replace('/<\!\[CDATA\[(.*)\]\]><\/script>/s','//<![CDATA[\1//]]></script>',$html);

question -

the output of this would be

<script type="text/javascript"><![CDATA    js code ... ]]></script> right?

is the cdata truly necessary? I typically use XHTML 1.0 transitional
and I don't have problems validating.


The problem is that validating xhtml does not necessarily render properly in some browsers *cough*IE*cough*

That's why I prefer to send html 4.01 to those browsers.

Would this function work for sending html and solve the utf8 problem?

function makeHTML($document) {
   $buffer = $document->saveHTML();
   $output = html_entity_decode($buffer,ENT_QUOTES,"UTF-8");
   return $output;
   }

I'll try it and see what it does.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux