This works but the "w" means that it writes over whats already in the file
(look at the manual about fopen for more details)
Advertising
$new_file = "txt/whatever.txt";
$fh = fopen($new_file , "w");
// write the changed new file
fputs ($fh, $new_code);
// now close the file
fclose($fh);
Regards
John
> lets say I have 30 lines of text and I want to store it in a folder called
> "txt" with the filename $name.txt and, if $name.txt exists, create a
> $name1.txt or similiar?
>
> Håkan
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php