Answers

Question and Answer:

  Home  Senior PHP Programmer

⟩ 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 testing global guideline filen" );

fclose( $file );

 160 views

More Questions for you: