I'm having some trouble writing data to a file, when I use this code it
works fine:

$file = fopen("template.txt", "w");

fwrite ($file, $temp);

fclose ($file);


But several problems with this occur:


$stuff = include ("news.txt");

$file = fopen ("news.txt", "w");

$newnews = include ("template.txt") . $stuff;

fwrite ($file, $newnews);


First of all, it tries to open template.txt1 instead of template.txt.

Second of all, some letters written to news.txt become a 1 for some odd
reason. I don't know why.

I am using a windows server and I have tried using the mode "wb" but it
doesn't help.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to