ztealmax Posted December 13, 2006 Share Posted December 13, 2006 [code]<?PHP require_once("theme.php");?><?php// set file to read$file = $_GET['text'];// open file $fh = fopen($file, 'r') /*or die('Could not open file!')*/;// read file contents$data = fread($fh, filesize($file)) /*or die('Could not read file!')*/;// close file fclose($fh); // print file contents ?><DIV class="smallblacktext"><? echo $data;?></DIV>[/code]My read text file script cant recognize line breaks from a .txt filefor example of text file:[code]This is my computer and it rocks....This is my keyboard and it rocks too..[/code]in my code it comes up like this:[code]This is my computer and it rocks....This is my keyboard and it rocks too..[/code]Does anyone know how to sort it out? Link to comment https://forums.phpfreaks.com/topic/30481-resolved-my-read-text-file-script-cant-recognize-line-breaks-from-a-txt-file/ Share on other sites More sharing options...
papaface Posted December 13, 2006 Share Posted December 13, 2006 [code]<DIV class="smallblacktext"><pre><? echo $data;?></DIV></pre>[/code]That should do it. Link to comment https://forums.phpfreaks.com/topic/30481-resolved-my-read-text-file-script-cant-recognize-line-breaks-from-a-txt-file/#findComment-140339 Share on other sites More sharing options...
ztealmax Posted December 13, 2006 Author Share Posted December 13, 2006 [quote author=devnerds link=topic=118444.msg484010#msg484010 date=1166012327][code]<DIV class="smallblacktext"><pre><? echo $data;?></DIV></pre>[/code]That should do it.[/quote]thanx worked great ;)however i didnt see [code]<pre></pre>[/code] saw it first when i comented you ;)Thanx :D** Noticed you saw that it wasnt showing up too ** ;) Link to comment https://forums.phpfreaks.com/topic/30481-resolved-my-read-text-file-script-cant-recognize-line-breaks-from-a-txt-file/#findComment-140340 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.