Go Back   CP Web Hosting - reseller hosting > Server Scripting > PHP
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-28-2007, 04:27 PM
Junior Member
 
Join Date: May 2007
Posts: 12
Default Need to wrap output in <pre> tags

For doing formatting with the printf(), there is need to wrap output in <pre> tags. Is this the best way of showing formatted plain text on a browser?
Reply With Quote
  #2 (permalink)  
Old 06-28-2007, 04:30 PM
Member
 
Join Date: May 2007
Posts: 48
Default

<pre> tags can be useful if you want to preserve plain-text formatting in an HTML context.
If you want to output an entire text document to the browser, however, it is neater to tell the browser to format the entire output as plain text. You can do this with the header() function:

Header ("Content-Type: Text/Plain");
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 05:10 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.1.0