jdock1 Posted May 15, 2009 Share Posted May 15, 2009 Im trying to make an application where a user can write to a line from a file template... how could I do this? To be more specific, I want to make an .htaccess generator, but there is only one line the user enters to generate the new file There is one text field in the application, the string the user enters in that line will write to the file and generate the file for them where they can download it I was looking into using fopen(),fwrite() functions etc, but this is a bit more complex and I have no idea how to do this.. Link to comment https://forums.phpfreaks.com/topic/158225-how-to-write-to-a-file/ Share on other sites More sharing options...
nadeemshafi9 Posted May 15, 2009 Share Posted May 15, 2009 <?php $fp = fopen('data.txt', 'w'); fwrite($fp, '1'); fwrite($fp, '23'); fclose($fp); // the content of 'data.txt' is now 123 and not 23! ?> http://uk.php.net/fwrite Link to comment https://forums.phpfreaks.com/topic/158225-how-to-write-to-a-file/#findComment-834626 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.