If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > PHP > show content of textfile

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-26-03, 09:03
harmen harmen is offline
Registered User
 
Join Date: Oct 2002
Posts: 18
show content of textfile

Hello,
I've run into a small problem. I made a site with php. By using the following code I can display the content of a textfile.

<?php $fpFile = fopen($file2[$val], "r");
$contents = fread($fpFile, filesize($file1[$val]));
fclose($fpFile);
echo $contents;
}
?>

My problem is that I would have breaks in the text showed as I see them in my text editor and not as one textblock

thanks
Reply With Quote
  #2 (permalink)  
Old 03-27-03, 03:17
hernst hernst is offline
Registered User
 
Join Date: Feb 2003
Location: Germany
Posts: 20
Re: show content of textfile

Hi,
Try something like the following:

echo '<pre>'.$contents.'</pre>';
or
echo nl2br($contents);

Greetings Jürgen
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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