faqts : Computers : Programming : Languages : PHP : Common Problems : Files

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

47 of 59 people (80%) answered Yes
Recently 7 of 10 people (70%) answered Yes

Entry

How do I create a file using php?

Feb 5th, 2002 07:27
Henrik Hansen, your mother, Ben Udall, http://www.php.net/manual/en/function.fopen.php


An example:
$fp = fopen("your_new_file.txt", "w");
fwrite($fp, "Some content in your file");
fclose($fp);
Also read the manual page for fopen():
http://www.php.net/manual/en/function.fopen.php