newbtophp Posted November 21, 2009 Share Posted November 21, 2009 How would i clear (empty/blank) the contents of a .txt without deleting file? \: I've looked at unlink() but that deletes the file aswell. Quote Link to comment https://forums.phpfreaks.com/topic/182346-solved-clear-contents-of-txt-without-deleting-file/ Share on other sites More sharing options...
Alex Posted November 21, 2009 Share Posted November 21, 2009 $fp = fopen('somefile.txt', 'w'); fclose($fp); Quote Link to comment https://forums.phpfreaks.com/topic/182346-solved-clear-contents-of-txt-without-deleting-file/#findComment-962259 Share on other sites More sharing options...
newbtophp Posted November 21, 2009 Author Share Posted November 21, 2009 Thanks Alex! lol theirs me thinking complex Quote Link to comment https://forums.phpfreaks.com/topic/182346-solved-clear-contents-of-txt-without-deleting-file/#findComment-962260 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.