I have a form with a textfield with wrap="physical", and a PHP page that fopen and writes it to a file.
If I open the file in a text editor, the carriage returns are there.
But if I "include" it in another web page, it's all on one line. I can literally write <br> in the textfield and the later INCLUDE (or rather the HTML I guess) will process the tags and all looks good...but I don't want to have to type a <br> every time I make a carriage return.

Any suggestions?
Thanks!
Liam

    Carriage returns don't work in plain html anyway. Maybe when you write to the file you could do it programmatically and replace all the \n with <br>

    hope this helps

      I'm afraid I don't know what \n is.
      Is that a "hidden character"?
      I tried a search in php.net for \n and came up with nothing.
      If you (or someone) could point me to where I can learn about \n, I'm sure I can figure out from there how to do the replacement.

      Thanks!
      Liam

        "\n" is very old unix code buried in the mists of time 😉

        it stands for newline

        Grits

          Thanks for the info!
          I checked around on nl2br and came up with the following sample code. Using variations of the (un)commented lines I can do anything I'd been wanted with carriage returns. =)
          Thanks!

          $body = nl2br($body);
          //$body = str_replace("<br />", "
          //", "$body");
          //
          //echo "<textarea name=body wrap=virtual cols=48 rows=12>";
          $body2 = strip_tags($body);
          $body2 = stripslashes($body2);
          //echo $body;
          //echo "</textarea>\n";

            Write a Reply...