This is my php code for fwrite function.
I want to output like oneworld than 2nd world on 2nd line and 3rd is on 3rd line
OUTPUT
05 10 2012 16:06:29 bonne
05 10 2012 16:06:29
05 10 2012 16:06:38 mauvais
05 10 2012 16:06:38
05 10 2012 16:06:44 pas bonne
05 10 2012 16:06:45
05 10 2012 16:07:17 trés bonne
05 10 2012 16:07:18
05 10 2012 16:07:34 bonne
05 10 2012 16:07:35
there is one line between each word.
here is my code can you please help me
<?php
$file = "testFile.txt";
$fp = fopen($file, 'a');
$name = $_POST['nom'];
$mood = trim($_POST['Humer']);
$date = date ("d m Y H:i:s");
$data = $mood;
fwrite($fp, "$date $data \n");
fclose($fp);
?>
You write to file only one variable
$moodwith line break after it.And about additional lines, try to trim data before: