kratsg Posted December 10, 2007 Share Posted December 10, 2007 some text file name:foo pass:bar status:inactive group:user Some action occurs with the user, such as an email validation (I'm setting up an example, I'm NOT actually coding this... xD) So, we read through the text file, when we approached "status:inactive" we change it to "status:active" and continue reading/updating the file... some text file name:foo pass:bar status:active group:user Is there a way we can accomplish this? Or must we read the file, manipulate what we've read, erase everything in the file, and copy the manipulated data back into the file? Quote Link to comment https://forums.phpfreaks.com/topic/80948-solved-file-writing-replace-on-the-go/ Share on other sites More sharing options...
trq Posted December 10, 2007 Share Posted December 10, 2007 Or must we read the file, manipulate what we've read, erase everything in the file, and copy the manipulated data back into the file? Thats the only way to do it using native php. Quote Link to comment https://forums.phpfreaks.com/topic/80948-solved-file-writing-replace-on-the-go/#findComment-410665 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.