Re: Reading from file
- From: Johannes Wienke <languitar@xxxxxxxxxx>
- Date: Sat, 04 Feb 2006 00:11:02 +0100
Hello,
Dalibor schrieb:
I have following code for putting contenst of a file into a web page:
<?php
$filename = "../msd/news.txt";
$handle = fopen ($filename, "r");
$content = fread ($handle, filesize($filename));
fclose($handle);
echo ($content);
?>
But in file news.txt I have formating that is not showing, but
interpreting.
For example, in that file there is:
<a href="link.php">link</a>
End result is hyperlink.
I think the problem has nothing to do with your PHP-Code. Can you post a
link with the result of your code an the textfile?
To shorten your code you can also use file_get_contents.
http://de.php.net/filegetcontents
Johannes
.
- Follow-Ups:
- Re: Reading from file
- From: jukka
- Re: Reading from file
- References:
- Reading from file
- From: Dalibor
- Reading from file
- Prev by Date: Reading from file
- Next by Date: Formulas in PHP
- Previous by thread: Reading from file
- Next by thread: Re: Reading from file
- Index(es):
Relevant Pages
|