Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

XHTML to HTML

Name: Anonymous 2007-03-17 22:26 ID:mmTvIK73

I'm currently working on a load of PHP to make my website show as XHTML with an application/xhtml+xml content-type to non-shitty browsers (Firefox, Opera, Safari) and as HTML with a text/html content-type to shitty browsers (Internet Explorer).

At this point I'm mostly done, but I've got one more minor issue that I want fix.

The code in both versions of the page has trailing slashes in some tags as is correct for XHTML, but I want to change that in the HTML version so "<br />"  becomes "<br>".

This is a very minor thing, but I'm fairly certain it can be done in PHP and would to do so.

Name: Anonymous 2007-03-18 4:16 ID:wWFL2CWI

>>7
Sorry, my code did not foresee the error-id 10-T, totally my fault.

At the top of the page you put «ob_start();», before aaaaany output.

And at the bottom of the page you put «$page=ob_get_contents();ob_end_clean();», then that code of yours, and then «echo $page;».

« and » is quotation marks. Feel free to include them in your code but be prepared to get a few error messages if you do.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List