hello
I've a little problem over here...
from a form, I'm getting a variable passed.. spit up in arrays. then i'm imploding the array and write it to a textfile. my problem is, how can I get a linebreak to the end of the line? \n (backslash-n) didn't work, and i'm kinda lost right now. sorry if this got already discussed, but the searchscript on this site seemed down when I tried it.
<code snip>
$filename = 'news.txt';
// open the file
$fd = fopen($filename, "r");
//read the contents of the file
$contents = fread ($fd, filesize($filename));
//close the file
fclose ($fd);
//remove the file
//so the newest entry is on top
unlink($filename);
//create new file
$fd = fopen($filename, "w");
$text = implode("", $news);
//write new entry
fputs($fd,$text);
//write old entry
fputs($fd,$contents);
//write file to disk
fclose($fd);