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. 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); 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 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
Archived
This topic is now archived and is closed to further replies.