Re: Reading A file
| From: | Julio Nobrega Trabalhando | Date: | Wed, 06 Mar 2002 13:40:38 +0000 |
| Subject: | Re: Reading A file | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-87459@lists.php.net to get a copy of this message | ||
If it's a file ending in .txt, you don't need PHP at all to make visual on
the web, most browsers will just display it on the screen. Just link to it.
But, if you want to echo it inside html, do:
<?php
$filename = 'path/to/file.txt';
$fd = fopen($filename,'r'); // might be 'rb', check manual page for fopen();
?>
From here, you might go with readfile(); or file(), that will display the
pointer's content (on this case, $fd). It might be necessary to change
newlines for <br>, though. (nl2br(); or similar)
--
Julio Nobrega.
Um dia eu chego lá:
http://sourceforge.net/projects/toca
Ajudei? Salvei? Que tal um presentinho?
http://www.submarino.com.br/wishlistclient.asp?wlid=664176742884
"Sven Jacobs" <sjacobs@contenteurope.com> wrote in message
news:477C19A65B5CD311A92000902798AB7101AD955E@alexone.alexsys.be...
> Hey
>
> I have a TEXT file that I want to make visual via the web using php
>
>
>