From Phpmaniac
Return to Contents
Create a new file
PHP makes creating a text file simple. All we need to do is open the file, write some contents, then close it.
<?php
$file = fopen("test.txt", "w+"); // Open the file
fwrite($file, "Hello World!"); // Write to the file
fclose($file); // Close the file
?>
Return to Contents