Forum Moderators: coopster

Message Too Old, No Replies

Complex php file script

searching file

         

rokec

2:32 pm on Nov 15, 2006 (gmt 0)

10+ Year Member




This is file.txt:
"Something\nSomething else\nWhatever\nNobody\nNobody"

There i have 5 lines. Is there a sciprt which will search this file for What and delete the line where is that string written.

For exmaple in this case script schould delete 3rd line.

Thanks for every help!

dreamcatcher

3:39 pm on Nov 15, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your best bet would probably be to loop through the file and ignore any lines that you want to remove. Then, delete the original file and rewrite the new data back to the file.

dc