ProAnswers.org

How to create a text file in php?

$filename = “/home/user/guest/newfile.txt”; $file = fopen( $filename, “w” ); if( $file == false ) { echo ( “Error in opening new file” ); exit(); } fwrite( $file, "This is a simple test
" ); fclose( $file );