Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Posts
    18

    Unanswered: 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

  2. #2
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •