Re: Including text with PHP and keeping blanks
| From: | DvDmanDT | Date: | Mon, 16 Jun 2003 23:27:56 +0000 |
| Subject: | Re: Including text with PHP and keeping blanks | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151749@lists.php.net to get a copy of this message | ||
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" <frefo253@student.liu.se> skrev i meddelandet
news:3EEE433C.4000508@student.liu.se...
> 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
>