Very new to PHP. I have made a script to output into a text file. Don't know how to format the text from the PHP code. Specifically I am trying to feed each variable to a new line rather than having it just wordwrap in editor. The "LF" seen in the code only creates a space between the outputs. It does not send to a new line. I don't have a book to assist me. Help please...

Here is the script:

<?php

$text = implode("LF",$_POST);

$date = $_POST['v2'];
$dated=$date;
touch ("/amarok1/jrj28/redlogdat/$dated");
$file = "/amarok1/jrj28/redlogdat/$dated";

$fp = fopen ("$file", "a+");

fwrite($fp, $POST['v1']);
fwrite($fp, $
POST['v2']);
print $text;
fclose($fp);

?>

    you are using a windows editor that does not recognize \n as a newline. you probably need \r\n for your version of word.

      in windows a 'newline' is denoted by \n\r which is a newline and carriage return and in linux its just a newline \n

      reg
      kevin

        Write a Reply...