Jump to content

Archived

This topic is now archived and is closed to further replies.

neugi

how to create a file on the server

Recommended Posts

Hi,

i want to create a file on the server.

i know how to write into a file, but i cant remember how to create a file with php where i can write inside.

thx

Share this post


Link to post
Share on other sites
if the file already exists, resaving will overwrite what is there. Otherwise, open the file, dump he data into a variable and add the new information to the end and resave.

Share this post


Link to post
Share on other sites
Hi,

i need to create a new file. there is no existing file where i can write into ;)

best

Share this post


Link to post
Share on other sites
It may sound confusing, but fopen() is used to create files.
if you write:
fopen("something.txt","w");
And something.txt doesnt exsist, it'll try to create it.

Note that the file will be created only using the modes w, w+, a and a+.

For more information, check [url=http://www.php.net/manual/en/function.fopen.php]fopen()[/url]

Orio.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.