What function do i use to create a new file?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
Rob_Beard
Forum Newbie
Posts: 23
Joined: Sat Oct 12, 2002 11:58 am

What function do i use to create a new file?

Post by Rob_Beard »

Hey all,

What function do i use to create a new file? All i can find is opening files, and saving to already created files?
User avatar
QWERTY
Forum Newbie
Posts: 20
Joined: Sat Jun 29, 2002 10:57 am
Location: Slovenia

...

Post by QWERTY »

Code: Select all

fopen( "my_file.txt", "w" );

Manual (fopen()):

'w' - Open for writing only; place the file pointer at the beginning of the file and truncate the file to zero length. If the file does not exist, attempt to create it.
Post Reply