Jump to content

[SOLVED] File Writing, replace on the go?


kratsg

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/80948-solved-file-writing-replace-on-the-go/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.