Hi there. I would like to write a new file on my server and write to it. Is the code below fine because the file mytext3.doc never gets written to the server. Thanks Tracy
$test="hello";
$a= fopen("mytext3.doc","r+"); fwrite($a,$test);
r+ does not trucate nor create the file. If the file doesn't exist, you'll want w+...
Also, don't forget to fclose the handle when you're done writing...
Hello again! It now works. Why should I close the file??
Otherwise you leave it open and won't be able to access it.
Ahhh.. I see! You're the best🙂 Tracy