Username: Posted November 29, 2010 Share Posted November 29, 2010 And how can I make it so if it does already exist, it doesn't over-write information already in it? Thanks Link to comment https://forums.phpfreaks.com/topic/220121-how-to-make-php-create-a-file-only-if-it-doesnt-exist/ Share on other sites More sharing options...
trq Posted November 29, 2010 Share Posted November 29, 2010 Check for its existence, file_exists. And how can I make it so if it does already exist, it doesn't over-write information already in it? Switching to mode 'a' will create the file if it doesn't exist and append to it if it does. Assuming your using fopen. Link to comment https://forums.phpfreaks.com/topic/220121-how-to-make-php-create-a-file-only-if-it-doesnt-exist/#findComment-1140835 Share on other sites More sharing options...
Username: Posted November 29, 2010 Author Share Posted November 29, 2010 Check for its existence, file_exists. And how can I make it so if it does already exist, it doesn't over-write information already in it? Switching to mode 'a' will create the file if it doesn't exist and append to it if it does. Assuming your using fopen. Thanks! Link to comment https://forums.phpfreaks.com/topic/220121-how-to-make-php-create-a-file-only-if-it-doesnt-exist/#findComment-1140836 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.