fOpen("TestFile.txt", "w+"); if(fwrite("Test data") === false){ echo("Data writing failed."); }else{ echo("Data writing successfull."); } fclose();