Answers

Question and Answer:

  Home  Junior PHP Developer

⟩ Tell me how to create a text file in php?

$filename = "/home/user/guest/myTextFile.txt";

$file = fopen( $filename, "w" );

if( $file == false )

{

echo ( "Error in opening new file" ); exit();

}

fwrite( $file, "This is a simple testn" );

fclose( $file );

 144 views

More Questions for you: