[PHP] Re: Including text with PHP and keeping blanks
Sorry, don't understand what you mean... If I understand it right, you want PHP to include HTML asis and make the text look like it would in notepad (with spaces and so on)... Like echo $istxt?pre.htmlentities(implode('',file($filename)))./pre:implode('' ,file($filename)); However, my code is often little confusing... You might have to add stripslashes() to the echo part to avoid \ all over your output... Hope it helped / DvDmanDT Fredrik Fornwall [EMAIL PROTECTED] skrev i meddelandet news:[EMAIL PROTECTED] Hello! I am just wondering if there exist some built-in function in PHP to include text files in HTML while retaining blank spaces and tabs. While I have found some text to HTML converting scripts I would prefer to let PHP format the text while including it into a web page, instead of creating a separate file first. Any suggestions? Thanks, Fredrik -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Including text with PHP and keeping blanks
Fredrik Fornwall [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hello! I am just wondering if there exist some built-in function in PHP to include text files in HTML while retaining blank spaces and tabs. While I have found some text to HTML converting scripts I would prefer to let PHP format the text while including it into a web page, instead of creating a separate file first. Any suggestions? echo pre$mytext/pre;// ;-) Unless you are going to render to a fixed-width font, your spacing will suffer anyway... or do you only care about left-hand spaces, ie for indenting? -- Hugh Bothwell [EMAIL PROTECTED] Kingston ON Canada v3.1 GCS/E/AT d- s+: a- C+++ L+$ P+ E- W+++$ N++ K? w++ M PS+ PE++ Y+ PGP+ t-- 5++ !X R+ tv b DI+++ D-(++) G+ e(++) h-- r- y+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Including text with PHP and keeping blanks
Hugh Bothwell wrote: echo pre$mytext/pre;// ;-) Unless you are going to render to a fixed-width font, your spacing will suffer anyway... or do you only care about left-hand spaces, ie for indenting? Thanks! I did not know about the pre tag, but this was what I needed (and yes, I only really care about indenting)!. Fredrik. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php