Re: problem with file writing
| From: | Jason Wong | Date: | Sun, 17 Mar 2002 06:55:59 +0000 |
| Subject: | Re: problem with file writing | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-88809@lists.php.net to get a copy of this message | ||
On Sunday 17 March 2002 12:53, Ben Waldher wrote:
> I'm having some trouble writing data to a file, when I use this code it
> works fine:
> <?php
>
> $file = fopen("template.txt", "w");
>
> fwrite ($file, $temp);
>
> fclose ($file);
>
> ?>
>
> But several problems with this occur:
>
> <?php
>
> $stuff = include ("news.txt");
>
> $file = fopen ("news.txt", "w");
>
> $newnews = include ("template.txt") . $stuff;
>
> fwrite ($file, $newnews);
>
> ?>
include() is not the way to read files, use the Filesystem Functions for that.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
A few hours grace before the madness begins again.
*/