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 Quote 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. Quote 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! Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.